Repository navigation
Description
Summary
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.createpayload is{id, parentID, title, agent, model, location, metadata, permissions, subagentPolicy}; there is nodirectoryfield.pm-stack/dispatch/src/opencode.ts:52-58— the working dispatch client sendslocation: { directory: opts.directory }.pm-stack/opencode-claimant/prompt.md:79-82— the claimant's instruction still says top-leveldirectory.- 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/userproject), not the code-repo project.
- task 7077 →
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.
Activity
dezren39 commentedon 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.mdin 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.directorymust 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 (themodelobject, task 5857; nowdirectory) 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 commentedon 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
23 remaining items
dezren39 commentedon 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 commentedon 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 commentedon Nov 4, 2026
🤖 Agent note · picked up
location: {directory}object on session create and verify the returnedlocation.directorybefore binding (Phase 2 of 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)directory, which the v2 API ignores — launched workers land in /home/user, not the repo primary #4870 · issue design: judge a session by its own record — the opencode-claimant's session contract (per-id reads, verified create, every bound state dispositioned) #4912Merge pull request #5336 from developing-today/queue/9312-4870-claima…
dezren39 commentedon Nov 4, 2026
🤖 Agent note · done
location: {directory}create body, model object retained, verify responselocation.directorybefore bind, mismatch/missing location = creation failure with per-id DELETE and no bind). The edited example was checked againstpm-stack/dispatch/src/opencode.tscreateSession 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.