GeezerVison is showing github.com — opencode-claimant: session create sends a top-level `directory`, which the v2 API ignores — launched workers land in /home/user, not the repo primary · Issue #4870 · developing-today/code
opencode-claimant: session create sends a top-level directory, which the v2 API ignores — launched workers land in /home/user, not the repo primary #4870DescriptionSummary
pm-stack/opencode-claimant/prompt.md tells the claimant to create the worker session with a top-level directory:
POST /api/session with JSON body {"directory": <the repo's laptop primary>, "title": ..., "model": {...}, "agent": "build"}
(prompt.md:79-82)
The v2 OpenCode server does not accept a top-level directory. session.create decodes location (Location.PublicRef = {directory}) and strips unknown keys, so the field is silently dropped and the session is created at the server default location — /home/user — not the repo primary.
Evidence
packages/protocol/src/groups/session.ts:221-234 — session.create payload is {id, parentID, title, agent, model, location, metadata, permissions, subagentPolicy}; there is no directory field.
pm-stack/dispatch/src/opencode.ts:52-58 — the working dispatch client sends location: { directory: opts.directory }.
pm-stack/opencode-claimant/prompt.md:79-82 — the claimant's instruction still says top-level directory.
- Observed sessions launched by the claimant with this shape:
- task 7077 →
ses_e5e5ef40dccffesEpg4GoSqzeZ, location.directory=/home/user
- task 7316 →
ses_e5e5ef64873ffedhQFx8Dz4k6h, location.directory=/home/user
- task 3275 →
ses_e5e5fd27fa1ffeOpTSf2l3D84t, location.directory=/home/user
- all three resolve to project
a3b70b365cae… (the /home/user project), not the code-repo project.
Impact
Workers do still do the right work because the prompt text names the directory ("Work in /home/user/git/code"), but the session runs under the wrong project: the server's per-project context (AGENTS.md discovery, project attribution, session listing/aggregation by project) is the /home/user project. It also makes session→repo attribution in the aggregator unreliable, and it is why bound-session listings mix dir=/home/user and dir=/home/user/git/code.
Fix
In prompt.md step 4b, replace the top-level directory with the v2 location object, keeping the model in the model object:
{"title": "...", "location": {"directory": "<repo primary>"},
"model": {"id": "workhorse", "providerID": "opencode-route"}, "agent": "build"}
A regression guard is worth having for the next launcher: assert that a created session's location.directory equals the requested repo primary before binding (the claimant can check the create response, which already returns location).
Found during the 2026-11-03 11:20Z fire of the opencode-claimant; this fire launched nothing because Supabase returned HTTP 544 (see the fire log), so the defect was documented rather than fixed inline. Activitydezren39 commented on Nov 3, 2026 Adopted as Phase 2 of design #4912 (judge a session by its own record — the opencode-claimant's session contract), filed by the fleet design architect, pass 44 (2026-11-03). Design doc: files/designs/code-claimant-session-contract.md in the keep-the-four-repos-healthy goal workspace.
Phase structure for triage: do NOT re-file, re-scope, or split this issue — it is the phase. The design records one strengthening of the issue's proposed fix: the regression guard is a required step, not optional — step 4b's create is verified before bind (the create response's location.directory must equal the requested repo primary; a mismatch is a creation failure, the task stays unbound, and the misplaced session is deleted per-id). Rationale in the design doc: two text-only shape fixes in this prompt (the model object, task 5857; now directory) have each cost a launch window. Phases 1 (#4757) and 3 (#4758) are independent; Phase 4 (#4916, closing audit) is gated on all three.
This filing is also the third claimant-contract filing — the trigger recorded at design pass 42 for originating #4912.
agent-note:v1 — design-architect adoption note, pass 44. dezren39 commented on Nov 3, 2026 agent-note:v1
state: triaged (coverage pass)
Coverage pass 2026-11-03: reviewed in the fleet-wide per-issue pass (drift / overlap / already-handled / stale / blockers / ordering). Verdict: still live; queued in repo-health-code-pilot as triage at priority 70 (priority/high). If this is already handled at current main, the triage closes it with evidence; if it needs splitting, the triage files the split.
Found via: coverage pass 2026-11-03 dezren39 commented on Nov 4, 2026 agent-note:v1
task 9312 (lane code-q): parked 20m for CI on PR #5336. Checks contract corpus and aggregator tests/typecheck remained QUEUED through a >5-minute poll (runner backlog; no failures). Codex review completed, no findings; diff verified against acceptance; claimant test_poll.py 21 tests passed on laptop (prior checkpoint). Resume: fresh-check PR #5336, merge when green, then complete task 9312. dezren39 commented on Nov 4, 2026 agent-note:v1
task 9312 resumed by lane code-g after its park: PR #5336 checks (contract corpus, aggregator tests and typecheck) are STILL QUEUED — they have been queued since the PR opened, a fleet-wide CI backlog, not a PR problem (docs-only prompt.md change; claimant test_poll.py 21 tests OK on the laptop). Task 9312 re-parks for CI. Resume: fresh-check PR #5336, merge when green, complete task 9312. dezren39 commented on Nov 4, 2026 dezren39 commented on Nov 4, 2026 🤖 Agent note · done
- Agent: queue worker (repo-worker-code), lane W shift
- Session / ID: task 9312
- Found via: queue claim
- Task: done — the fix already existed as PR fix(claimant): v2 location object + verify before binding (#4870) #5336 (opened by lane code-g for task 9312, branch queue/9312-4870-claimant-location); this shift verified it instead of duplicating it and merged it
- Verification: diff is prompt.md-only and matches every acceptance item (v2
location: {directory} create body, model object retained, verify response location.directory before bind, mismatch/missing location = creation failure with per-id DELETE and no bind). The edited example was checked against pm-stack/dispatch/src/opencode.ts createSession on current main — identical shape. No Codex findings were posted on PR fix(claimant): v2 location object + verify before binding (#4870) #5336. The one failing check (pm-aggregator tests: 2 health-inbox tests, feat(aggregator): source-conflict inbox — one resolvable queue for Project-vs-derived and Kaneo-vs-GitHub disagreements, with per-class trust rulings #1282) is pre-existing on main — the same workflow failed on main pushes at 07:32Z and 08:09Z today — and is unrelated to this prompt-only change; the contract corpus check passed.
- Links: PR fix(claimant): v2 location object + verify before binding (#4870) #5336 (merged, e886a92) · issue design: judge a session by its own record — the opencode-claimant's session contract (per-id reads, verified create, every bound state dispositioned) #4912
dezren39 commented on Nov 10, 2026
state: phase-4-audit
task: 13022
lane: code-w
issue: "#4916"
Phase 4 closing audit of design #4912 (issue #4916, PR #8224) — origin summary for this phase:
Phase 2 (this issue, #4870) — landed and closed. Session create in claimant.py is verified before bind: the created session is read back per-id and its location.directory confirmed before any bind (the v2 API had ignored the top-level directory, landing workers in /home/user). A create that cannot be verified is deleted, never bound — now contract rule 2 (verify before bind) in the README's Session Contract section.
Phase 4's inventory dispositions POST /api/session and the per-id read-back compliant. This issue stays closed; no acceptance item was found unmet.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|