Repository navigation
fork seams: announce the t3_environment_read facts lines (placement P3, step 1) - #779
Merged
Merged
Conversation
…3, step 1) List only (step 1 of "Adding a seam line"). Placement design row P3 (facts out) makes t3_environment_read return this machine's facts beside upstream's fields: hostResources (the result field of upstream PR pingdotgg#34293) and the fork's placement (labels, available and reason, running agents, slots free, memory floor, facts time). The logic lives in the fork file apps/server/src/fork/environmentFacts.ts; each of upstream's two environment toolkit files takes its import and one line. - environment/handlers.ts: the read spreads EnvironmentFacts.read into its result. - environment/tools.ts: the success schema takes EnvironmentFacts.ResultFields (both optional, so an older linked machine that leaves them out still decodes). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scuttletoby
force-pushed
the
fork/seams-p3-facts-out
branch
from
November 21, 2026 20:06
d051e47 to
d235819
Compare
scuttletoby
added a commit
that referenced
this pull request
Nov 21, 2026
…nd placement t3_environment_read now returns two optional fields beside upstream's, for this machine and for a linked one (the read is forwarded there as before): - hostResources: CPU, cores and memory from HostResources, the result field of upstream PR pingdotgg#34293 (closed upstream without merging), same name and schema. Its export in McpHttpServer.ts, its lines in upstream test files and its new tool description are not carried: the fork adds no lines there. The fork file finds the sampler with Effect.serviceOption instead of a new tool dependency, so no upstream test needs a new mock. Its tests moved to fork test files. - placement: labels (empty: no setting holds them yet, P2 adds it), available and reason, runningAgents, slotsFree, memoryFloorMb, freeMemoryMb from the slot gate's existing status read (SlotGate.usage), and factsAt. A slot gate that cannot be read (fails, dies, takes longer than its own count limit, is not running, or the settings cannot be read) gives available: false with a reason and no count. A linked machine on an older T3 leaves both fields out: no facts, not a failed read. Nothing is stored; each read measures again. Result fields are not in the measured tool list, so the budget files are unchanged. The two environment toolkit files take the four lines announced in #779, moved from announced to added. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 21, 2026
scuttletoby
added a commit
that referenced
this pull request
Nov 22, 2026
…nd placement (#820) t3_environment_read now returns two optional fields beside upstream's, for this machine and for a linked one (the read is forwarded there as before): - hostResources: CPU, cores and memory from HostResources, the result field of upstream PR pingdotgg#34293 (closed upstream without merging), same name and schema. Its export in McpHttpServer.ts, its lines in upstream test files and its new tool description are not carried: the fork adds no lines there. The fork file finds the sampler with Effect.serviceOption instead of a new tool dependency, so no upstream test needs a new mock. Its tests moved to fork test files. - placement: labels (empty: no setting holds them yet, P2 adds it), available and reason, runningAgents, slotsFree, memoryFloorMb, freeMemoryMb from the slot gate's existing status read (SlotGate.usage), and factsAt. A slot gate that cannot be read (fails, dies, takes longer than its own count limit, is not running, or the settings cannot be read) gives available: false with a reason and no count. A linked machine on an older T3 leaves both fields out: no facts, not a failed read. Nothing is stored; each read measures again. Result fields are not in the measured tool list, so the budget files are unchanged. The two environment toolkit files take the four lines announced in #779, moved from announced to added. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Placement design row P3, step 1 (announce only).
Step 1 of "Adding a seam line" in docs/fork/updates.md: the list only. P3 (facts out) makes
t3_environment_readreturn this machine's facts beside upstream's fields, so an agent can choose a machine:hostResources: CPU, cores and memory fromHostResources. It is the result field of upstream PR feat(server): let agents read host CPU and memory load through t3_environment_read pingdotgg/t3code#34293, which was closed upstream without merging (moved to a discussion). Same field name, same schema, optional.placement: the fork's own facts.labels(declared facts; no setting holds them yet, so they stay empty until P2 adds it),availableandreason, running agents, slots free, the memory floor and free memory (read from the agent slot gate's existing status read,SlotGate.usage), andfactsAt.The logic goes in a new fork file,
apps/server/src/fork/environmentFacts.ts. Each of upstream's two environment toolkit files needs only its import and one line. This PR announces them; the P3 code PR moves them toadded.apps/server/src/mcp/toolkits/environment/handlers.ts(new entry,"added": [], newannouncedblock):import * as EnvironmentFacts from "../../../fork/environmentFacts.ts"; // Fork (P3): facts out...(yield* EnvironmentFacts.read), // Fork (P3): facts out, as the last property of the objectt3_environment_readreturns.apps/server/src/mcp/toolkits/environment/tools.ts(new entry,"added": [], newannouncedblock):...EnvironmentFacts.ResultFields, // Fork (P3): facts out, as the last field oft3_environment_read's success struct.Why only these lines, and not pingdotgg#34293 as it is:
McpHttpServer.ts(consttoexport const) andenvironment/handlers.test.ts. Both arependingfiles, which may take no new fork line, and swapping an upstream line counts as one. It also changes the tool's description line, which a pull request may not do (it would lose an upstream line).HostResourcesto the tool's dependencies, which needs a mock line in the upstream testAgentContextBudget.test.ts. The fork's module finds the host sampler and the slot gate withEffect.serviceOptioninstead, likecheckLaunchSlotdoes. So the toolkit's requirements do not change, and no upstream test file changes.Each line was applied to the files on origin/main together with the fork module, and
apps/servertypechecks with them. They were then put back.The tool byte budget does not change.
AgentContextBudget.test.tsandForkAgentContextBudget.test.tsmeasure only each tool's name, description and input schema. A result field is not in that list, and the description is unchanged.General vs project
General: seam-list entries for a fork feature (machine facts on
t3_environment_read, for choosing where an agent runs) that any user of a T3 fork can use. Nothing here is about one project.Checks
node --test .github/scripts/fork-seam-check.test.cjs: 114 of 114 pass.node .github/scripts/fork-seam-check.cjs --config-ref origin/main origin/main HEAD: green.since.🤖 Generated with Claude Code