Skip to content

fork seams: announce the t3_environment_read facts lines (placement P3, step 1) - #779

Merged
scuttletoby merged 2 commits into
mainfrom
fork/seams-p3-facts-out
Nov 21, 2026
Merged

scuttletoby merged 2 commits into
mainfrom
fork/seams-p3-facts-out

Conversation

@scuttletoby

Copy link
Copy Markdown
Owner

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_read return this machine's facts beside upstream's fields, so an agent can choose a machine:

  • hostResources: CPU, cores and memory from HostResources. 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), available and reason, running agents, slots free, the memory floor and free memory (read from the agent slot gate's existing status read, SlotGate.usage), and factsAt.

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 to added.

  • apps/server/src/mcp/toolkits/environment/handlers.ts (new entry, "added": [], new announced block):
    • import * as EnvironmentFacts from "../../../fork/environmentFacts.ts"; // Fork (P3): facts out
    • ...(yield* EnvironmentFacts.read), // Fork (P3): facts out, as the last property of the object t3_environment_read returns.
  • apps/server/src/mcp/toolkits/environment/tools.ts (new entry, "added": [], new announced block):
    • the same import;
    • ...EnvironmentFacts.ResultFields, // Fork (P3): facts out, as the last field of t3_environment_read's success struct.

Why only these lines, and not pingdotgg#34293 as it is:

Each line was applied to the files on origin/main together with the fork module, and apps/server typechecks with them. They were then put back.

The tool byte budget does not change. AgentContextBudget.test.ts and ForkAgentContextBudget.test.ts measure 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.
  • The P3 code branch's seam check passes against this PR's list. Against main's list it stays red until this PR merges.
  • State: an announcement lasts 14 days (since 2026-11-21). If the code PR does not land in that time, fork-follow refuses it, and the lines must be announced again with a new since.

🤖 Generated with Claude Code

…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
scuttletoby force-pushed the fork/seams-p3-facts-out branch from d051e47 to d235819 Compare November 21, 2026 20:06
@scuttletoby
scuttletoby merged commit d4dccd3 into main Nov 21, 2026
30 checks passed
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>
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant