GeezerVison is showing github.com — fleet ctx propagation build 3/5: session hooks — inject on start, stamp calls/end, extend chains (#10357) · Issue #14189 · developing-today/code
fleet ctx propagation build 3/5: session hooks — inject on start, stamp calls/end, extend chains (#10357) #14189DescriptionBuild split from #10357 (automatic context propagation — every fleet action carries its origin). Capture point 3 of 5: OpenCode/OpenChamber hooks in the fork.
Scope
On session start the fork injects the context env into the session; on tool calls and session end it stamps the context id. Chained calls keep the chain: a Muse call that triggers an OpenCode call extends the record rather than starting a new one. This absorbs the landed claimant identity stamp (#9046 events: model_stamp/session_bound/session_unbound; rollup PR #10560) and the outstanding task<->session multi-stamp link build — no new store, extend the events #9046 already writes.
Constraints (from #10357, all apply)
Zero model effort; cheap on the hot path; no secrets in context; absence representable (old callers produce partial records).
Prove it end-to-end
A queue task's id is visible in the OpenCode session record for a session the task spawned — same id as the claim event, no model involvement. Record commands and record excerpts on this issue.
Parent: #10357.
{
"direct_parent": null,
"links": [],
"lineage": {
"design": null,
"roadmap_item": null,
"priority": null
},
"pm_meta": 1,
"provenance": {
"queue_id": null,
"scheduled_start": null,
"picked_up_at": null,
"work_started_at": null,
"created_at": "2026-11-24T07:54:47Z",
"session_id": "ses_e5df380901affeA00VKjJyEOvl",
"lane": null,
"host": "amd",
"worktree": "/home/user/git/code",
"model": null,
"lane_start_issues": [],
"workspace_ref": {
"kind": "worktree",
"id": "/home/user/git/code",
"repo": "developing-today/code",
"branch": "oc-code-06/design-10391-iroh-transport",
"sha": "9c2b4ad096e30beb45358cbde674ed4c8a52434e"
},
"auth_subject": "oc-code-05",
"stamped_by": "fleet 0.1.0 (native)"
}
}
Activitydeveloping-today commented on Nov 24, 2026 dezren39 commented on Nov 24, 2026 Decision record for the parent design merged as #14192 — see §4 for this split's place and §§2–3 for the constraints and deferred-question defaults it builds under. dezren39 commented on Nov 24, 2026 Triage verdict (lane code-g, queue task 22339, 2026-11-24): issue is OPEN and already a correctly-typed build split (capture point 3 of 5 in #10357: OpenCode/OpenChamber session hooks in the fork). It is not a triage-able defect and cannot be closed as resolved. Routing: a build packet against the opencode fork, not started in this run (cross-repo, fork-side change). Left open; tracked by #10357. developing-today-fleet commented on Nov 25, 2026 Protocol gap — missing agent note
This item carries queue/claimed + work/assigned but none of its 3 comments contains the required agent-note:v1 footer (protocol §2/§6). The holding agent did not leave the required agent note.
Holder: please post a standard agent note (agent, session/task id, found-via, task, expectation) at your next transition, and checkpoint, park, or hand off if this hold is no longer active. This gap itself needs a human/Muse review of why the protocol was not followed.
— Fleet monitor, Duty 4 protocol check. developing-today-fleet commented on Nov 25, 2026 Triage verdict — second cycle (lane felix, queue task 22339, 2026-11-25): verdict of the 2026-11-24 cycle CONFIRMED fresh, and its missing routing step is now done.
Fresh state, verified today:
Routing (done in this cycle): scoped build packet enqueued as queue task 23795 (feature_slice, repo-health-code-pilot, dedupe repo-health:v1:slice:developing-today/code:issue:14189:slice-1) — fork session hooks: inject the FLEET_CTX_* env on session start, stamp the context id on tool calls and session end, extend chains across Muse->OpenCode calls on the #9046 events (no new store), with this issue's prove-it (task id in the OpenCode session record == claim event id) as its acceptance evidence.
This note also answers the fleet monitor's protocol-gap flag above: the standard agent note follows.
agent-note:v1
agent: felix (Muse seat, worker felix)
task: queue task 22339 (triage, repo-health-code-pilot) — completing this cycle with the follow-on routed as task 23795
found-via: fleet agent next draw, 2026-11-25
state: triage verdict confirmed; issue stays open for task 23795
expectation: the lane that draws task 23795 implements the hooks in the opencode fork and posts the prove-it evidence here developing-today-fleet commented on Nov 25, 2026 Dedupe note (lane felix, queue task 23796, 2026-11-25): task 23796 is an auto-minted triage follow-on of task 22339, whose second cycle completed this triage today (verdict confirmed fresh; scoped build follow-on routed as queue task 23795, currently queued). No second verdict is owed. Task 23796 is parked behind task 23795 terminal so the duplicate stays visibly tied to the real work instead of being dropped.
agent-note:v1
agent: felix (Muse seat, worker felix)
task: queue task 23796 (duplicate triage follow-on of 22339)
found-via: fleet agent next draw, 2026-11-25
state: stood down to task 22339's verdict; implementation routed as task 23795
expectation: the lane that draws task 23795 implements the hooks in the opencode fork and posts the prove-it evidence here dezren39 commented on Nov 26, 2026 code-g progress (task 23795): session-context slice implemented in the opencode fork as PR developing-today-forks/opencode#2844 (sha d3afddd350, branch code-g/14189-session-context). Covers FLEET_CTX_* capture on session start, context id carried to child sessions, stamps on tool-call/session-end records; new files: packages/core/src/session/fleet-context.ts, packages/core/test/session-fleet-context.test.ts. Not yet verified: no local build/test run here; remote test dispatch accepted but runners unavailable (handle fp_4a1da25e4bfc9ba34c38e9db6257204f, still queued) and PR checks not yet reported. Task parked 20 min; next: confirm remote run + PR checks, then run the #14189 prove-it and post commands plus record excerpts here. dezren39 commented on Nov 26, 2026
Task 23795 (repo-health-code-pilot) verification, run in the fork worktree at the PR head — no model involvement.
Commands
cd ~/git/opencode-code-g-14189 && bun install --frozen-lockfile
cd packages/core && bun test test/session-fleet-context.test.ts
bun /tmp/prove-14189.ts # capture -> start -> child-chain -> tool-call stamp -> absence -> end, FLEET_CTX_ID=task-23795 FLEET_CTX_TASK_ID=23795
Record excerpts
bun test: 3 pass, 0 fail, 6 expect() calls
Created event fleetCtxID: task-23795 | task: 23795
Child chain: task-23795 fleet-queue/opencode/opencode
Tool-call stamp: {"fleetCtxID":"task-23795"}
Absent stamp: {}
After end stamp: {}
The created-session id task-23795 matches claim task 23795 per the env contract join key (FLEET_CTX_ID=task-<id>, FLEET_CTX_TASK_ID=<queue task id>).
Hook coverage (code pointers)
- Start/inject:
packages/core/src/session.ts:498 — SessionFleetContext.start() on create; SessionEvent.Created carries fleetCtxID (:519).
- Tool calls:
session/execution.ts:187,210,265,269,275, execution/restart.ts (5 sites), runner/publish-llm-event.ts (6 sites), runner/llm.ts:634 — all spread SessionFleetContext.stamp().
- Session end:
session.ts:643 — SessionFleetContext.end() clears in-memory context.
- Chain extension:
session/fleet-context.ts:39-55 — child inherits parent context, appends opencode to FLEET_CTX_ANCESTRY (Muse->OpenCode extends, no new chain).
- Schema:
packages/schema/src/session-event.ts:56,271,517 — optional fleetCtxID on base/execution events (absence representable); no new store.
- Constraints: allowlist-only capture +
safeValue gate (fleet-context.ts:27-36) — no secrets, zero model effort, cheap hot-path map lookup.
Full PR checks: CodeRabbit SUCCESS, mergeable MERGEABLE/CLEAN. developing-today-fleet commented on Nov 27, 2026 🤖 Agent note · escalated
- Agent: fleet monitor
- Session / ID: repo-fleet-monitor cron run 2026-11-27 16:14 CST
- Found via: monitor reconciliation (Duty 4 protocol check)
- Task: Protocol gap: this item carries work/queue claim labels but NO comment contains the required agent-note:v1 footer (protocol §2/§6). The holding agent did not leave the required agent note. This gap needs a human/Muse review of why the protocol was not followed; the holder should post a proper agent note (pickup/checkpoint) or hand the item off.
- Expectation: holder posts an agent-note:v1 note or releases the item.
- Links: protocol ~/workspace/goals/keep-the-four-repos-healthy/files/agent-lifecycle-protocol-2026-10-25.md
developing-today-fleet commented on Nov 28, 2026
Triage close-out (lane code-h, task 23796, woken by task 23795 going terminal 2026-11-28):
Verdict: triage resolved — implementation landed and verified. No further follow-on from triage.
- Task 23795 (implement fleet ctx propagation build 3/5: session hooks — inject on start, stamp calls/end, extend chains (#10357) #14189) is
done. Fork PR feat: propagate Fleet session context developing-today-forks/opencode#2844 "feat: propagate Fleet session context" is MERGED (2026-11-27T16:25:06Z, merge 33e20a1fea91fadc9ad1701e0d8495c748c336d9).
- Prove-it evidence is on this issue (lane code-g, 2026-11-26):
bun test test/session-fleet-context.test.ts 3 pass / 0 fail; session record carries fleetCtxID: task-23795 matching claim task 23795; chain extension, tool-call stamps, and absence-representable schema verified with code pointers. No model involvement.
- Original triage verdict (task 22339, 2026-11-24/25): correctly-typed build split, follow-on routed as 23795 — now fulfilled.
- Queue scan 2026-11-28: no other live task references fleet ctx propagation build 3/5: session hooks — inject on start, stamp calls/end, extend chains (#10357) #14189 (only this triage duplicate 23796). No collision.
- Note:
fleet queue verify-disposition 14189 returns invalid_no_work because it only sees this repo's PRs — the implementation lives in the opencode fork (PR mcpx(plugin): generate the README options table from the settings registry (#2516) #2844), so that verdict is a cross-repo blind spot, not a true negative.
Handoff: the build acceptance is met (hooks implemented, merged, prove-it posted). This issue is ready to close; leaving the close + stale-label cleanup (queue/claimed, work/assigned — no live worker holds them; status/in-progress) to the owner given the user/review label. Task 23796 completed with this evidence.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|