Skip to content

impl(fleet): session state — session id in env + worktree pwd-file #9075

Open

Description

@developing-today-fleet

Design: doc/2026-11-12T22-50-00Z_design_pm-board-hierarchy-genealogy/note.md section 14. Each fleet start assigns a session id, stored in the environment of everything fleet launches AND in a pwd-file at the repo root of every worktree it operates in.

Acceptance:

  • fleet start writes the session id to env + pwd-file; a later bare fleet invocation in the worktree recovers it without being told.
  • Resolution order demonstrated: explicit argument > env > pwd-file.
  • The create-path stamp (fleet gh superset slice) records the recovered session id into provenance.session_id on a real created item.
  • Pwd-file location/name documented in the fleet docs; stale pwd-files (session ended) are detectable and do not silently misattribute new work.

Activity

  1. developing-today commented on Nov 12, 2026

    @developing-today
    Contributor
  2. dezren39 commented on Nov 13, 2026

    @dezren39
    Member

    Cross-link: #9178 §1 builds on this session-state work — a new resume_session_id column on the queue tasks table names the session a claim should continue, using the env / pwd-file session identity specified here. Companion decision record seed: FDR-0001 in #9180.

  3. dezren39 commented on Nov 17, 2026

    @dezren39
    Member

    Agent note — triaged (lane any-m, task 18825)

    State: triaged
    Work kind: task/small-fix (implementation in the fleet multicall binary)
    Priority: priority/normal — fleet/PM-stack infrastructure (priorities brief line 4, PM stack as a real hub); not fleet-stalling, so not band 10. It is however a named dependency: #9178 builds on it, and MOB-07 / DSP-05 slices are dep-blocked in part on #9075.
    Effort: effort/m

    Fresh verification (2026-11-17):

    • Issue impl(fleet): session state — session id in env + worktree pwd-file #9075 is OPEN, labels kind/feature + app/pm-stack only; no held / user/owned / do-not-merge / do-not-auto-edit labels.
    • No implementation on current main (22e7682): no fleet session-id env assignment, no worktree pwd-file, no resolution-order code in pkgs/fleet or pm-stack (the MCPX_SESSION_ID hits are the unrelated mcpx session mechanism).
    • Design source is doc/2026-11-12T22-50-00Z_design_pm-board-hierarchy-genealogy/note.md section 14.
    • Consumer gate: acceptance item 3 (create-path stamp writes provenance.session_id) depends on impl(fleet): fleet gh Metadata superset — create-path stamping + DB insert (extends #9016) #9073, which is still OPEN — that integration point is sequenced in the follow-on, not a blocker for the core session-state work (env + pwd-file + resolution order + stale detection + docs are independent).

    First concrete step for the follow-on: in the fleet binary, assign a session id at fleet start, export it to launched children, write the pwd-file at each operated worktree root, and implement recovery with resolution order explicit argument > env > pwd-file, with stale pwd-file detection.
    Acceptance check for the fix: all four acceptance items on this issue demonstrated, including the #9073 create-path stamp recording the recovered session id once that slice is available (or the follow-on is dep-blocked on #9073 for that item only).

    Follow-on: a scoped small_fix queue packet for this issue is enqueued by this triage (dedupe-checked); this triage task completes as triaged naming it.

  4. added
    task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests
    priority/normalOrdinary priority (the default)
    effort/mMedium: expected under 1 day of work
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 17, 2026
  5. 52 remaining items

  6. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    queue/claimedQueue worker lifecycle state
    and removed
    queue/claimedQueue worker lifecycle state
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 22, 2026
  7. dezren39 commented on Nov 22, 2026

    @dezren39
    Member

    Claimed task 20275 and revalidated current state: #9075 is open, #12326 is the canonical open PR, and no hard-stop labels are present. Resuming the existing branch/worktree; the old handoff gate is not a hold under current ownership policy. I will work only the remaining #9075 scope; create-path provenance remains dependent on #9073.

  8. dezren39 commented on Nov 22, 2026

    @dezren39
    Member

    Progress — task 20275 (oc-code-02 / repo-worker-code)

    Updated the existing canonical PR #12326 (no competing PR) with OpenCode shell-hook export of FLEET_SESSION_ID, Fleet init/domain persistence, format validation, inherited child environment, per-worktree marker ignore/docs, and regression coverage ensuring dispatcher-level malformed serve lists and queue version forms do not resolve session state.

    Verification: cargo test -p fleet --bin fleet — 85 passed; cargo fmt --all -- --check, git diff --check, and git diff --check origin/main...HEAD passed. The focused Bun test remains unverified: previous run timed out/crashed with Bun OOM (also under --smol).

    #9073 remains OPEN, so create-path provenance.session_id acceptance is still deferred; #9075 remains OPEN. Commit: 22bf6e1643.

  9. dezren39 commented on Nov 22, 2026

    @dezren39
    Member

    Verification follow-up for task 20275: retried bun test .opencode/plugin/mcpx/session-created.test.ts after the Rust suite finished; Bun 1.4.4 again timed out at 120s and reported out-of-memory (8.52 GB peak RSS). The test remains unverified. Queue task 20275 is recorded complete with canonical PR #12326 as the deliverable; issue #9075 remains OPEN with status/in-review, and #9073-dependent create provenance is still outstanding.

  10. added a commit that references this issue on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/mMedium: expected under 1 day of workkind/featureNew feature or capability requestpriority/normalOrdinary priority (the default)status/in-reviewtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions