Skip to content

feat: API launch mode that disables the question tool entirely for detached / non-interactive sessions #1885

Closed

Description

@dezren39

Request (Drew, 2026-11-06)

Sessions launched through the API in a specific way — a flag/option on session create, e.g. a detached / non-interactive mode — should have the question tool unavailable: absent from the toolset, or hard-erroring with a clear "disabled in this mode" result the model can route around (record the question, pick the documented default, continue).

Why

Evidence: the 2026-11-06 subsession workshop test, filed as #1881 (production server, 8 test sessions, plan pools only; every behavior claim production-measured and re-verified against the session store + route_attempt).

The workshop (#1881 Q6) proved a subsession's question call stalls the child and its foreground parent silently for 10+ minutes, and retry machinery can turn it into a re-ask loop. Detached fleet sessions run under a standing rule — never call question, record the question and keep working — but that rule currently lives only in launch-prompt text. A launch-mode guarantee makes it structural instead of instructional.

Scope / design questions

  • Shape: boolean/option on session create (e.g. question: "disabled" or a detached mode bundling related defaults) vs an agent-config default vs both (config default, per-session override).
  • Default posture: off = today's behavior everywhere. Nothing changes for interactive/attached sessions unless the launcher opts in.
  • Semantics when called anyway (tool restored by config merge, stale session, etc.): immediate tool error result naming the mode — never a form, never a block.
  • Interaction with permissions config: how this composes with the existing tool-permission surface — is it a permission preset, a separate axis, or an override that wins over permissions? Decide and document.
  • Inheritance: children of a disabled-mode session inherit the mode (a detached tree should not sprout an interactive leaf).
  • Cross-ref: the stall bug (very high priority, filed alongside) and question escalation to the parent (filed alongside) — this mode is the third leg: prevent, escalate, or surface; all three are wanted.

Acceptance sketch

  • Session created with the mode on: question is absent from its tool list (or errors immediately with the mode named); children inherit it.
  • Session created without it: behavior byte-identical to today.
  • The mode is visible in session metadata so an orchestrator can verify a tree is detached-safe.

Acceptance criteria

  • An API launch option (detached / non-interactive mode) exists under which the question tool is absent from the toolset or hard-errors with a clear 'disabled in this mode' result.
  • Sessions launched in this mode never block a foreground parent chain on an unanswerable form.
  • Interactive launches are unaffected.

Activity

  1. added
    kind/featureNew feature or capability request
    priority/highImportant and time-sensitive
    effort/mMedium: expected under 1 day of work
    source/humanFiled directly by a human
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    on Nov 6, 2026
  2. dezren39 commented on Nov 6, 2026

    @dezren39
    Author

    Intake review

    Requested by Drew 2026-11-06 (per the issue body). Part of the workshop cluster from opencode issue #1881 (Q6 stall + re-ask loop). Related: issue #1883 (the underlying stall bug — this mode is the prevention lane, not the bug fix), issue #1884 (escalation alternative), issue #1890 (description warning). Suggested approach: gate the tool at session-create time so the model routes around it from the first turn.

    — fleet monitor intake (Duty 2), 2026-11-06 run. Acceptance criteria appended to the issue body; labels normalized.

  3. dezren39 commented on Nov 7, 2026

    @dezren39
    Author

    Picked up — fleet feature wave, 2026-11-06 evening
    Building: the API launch mode that disables the question tool for detached/non-interactive sessions (session-create option; tool absent or hard-erroring with a route-around result).

  4. dezren39 commented on Nov 7, 2026

    @dezren39
    Author

    Fleet feature wave — minder note, 2026-11-06 evening: the first pickup session fell into a degenerate loop (repeated route attempts returning ~4 output tokens, no progress) and was interrupted by the minder. Its uncommitted work in the worktree is preserved; a successor session has picked up the same branch (fw/oc1885-disable-question-mode), is inventorying the inherited diff, and will finish the implementation, tests, and PR from there.

  5. dezren39 commented on Nov 7, 2026

    @dezren39
    Author

    Progress (continuation session): adopted the prior session's uncommitted work — detached: true on session create (schema/protocol/server/client), persisted in session_v2.detached, inherited by children/forks, enforced as a final deny rule via Permission.effectiveRules (so question is absent from the toolset; if called anyway it hard-errors with 'disabled in this mode'). Discarded: the migration's duplicate workspace ALTERs (generator drift; they already exist in 20261105070500 and would fail on existing DBs). Next: run full suites for touched packages, commit, PR. Note: 4 tests in core/test/tool-subagent.test.ts fail on base too (pre-existing).

  6. dezren39 commented on Nov 7, 2026

    @dezren39
    Author

    Fleet feature wave — minder note 2, 2026-11-06 evening: the successor session stalled with the same signature as the first (route attempts returning ~4 output tokens, no assistant message, on the specialist route / claude-sonnet-5-5 via the claude-code provider) and was interrupted. The stream has been relaunched on the workhorse route in the same worktree/branch; the inherited uncommitted work is intact and being inventoried now. The stall pattern itself is filed as a separate fork issue with route_attempt evidence.

  7. dezren39 commented on Nov 7, 2026

    @dezren39
    Author

    Progress (continuation): audited the preserved diff against the session contract and subsession design; keeping the create/event/projection/store/inheritance changes and the existing migration (no additional discards). Regenerated the client from after the Protocol API change. Focused tests pass for detached tool discovery, the explicit detached-mode error at the question leaf, permission denial, session create/tree/fork inheritance, and subagent launch propagation. A combined 4-file run had 171 passing tests plus 6 unrelated failures/timeouts: the already-known depth/model-governance failures and two live shell tests timing out in this environment. Next I’m validating generated DB artifacts and package typechecks, then I’ll run the full touched-package suites and decide merge eligibility from those results.

  8. dezren39 commented on Nov 7, 2026

    @dezren39
    Author

    Correction to the progress note just posted: shell quoting removed the inline-code names, but the results are unchanged. The preserved detached: true changes match the session and subsession contracts; no extra source changes were discarded. Client artifacts were regenerated from packages/client. Focused detached-mode, permission, create/inheritance, fork, and subagent-propagation tests pass. The combined 4-file core run had 171 passes and 6 failures/timeouts in the known subagent depth/model-governance tests and two live shell tests. Next: verify generated DB artifacts and package typechecks, then run the touched-package suites and determine merge eligibility.

  9. dezren39 commented on Nov 7, 2026

    @dezren39
    Author

    Progress: the full Core suite has been running over 20 minutes and reported a timed-out session-revert test. Focused feature tests pass; Core, Schema, Protocol, and Server typechecks pass; Client (281), Schema (108), and Protocol (9) package suites pass; migration and OpenAPI generation checks are clean. I will treat the full Core suite as a local gate failure and leave the PR open if it remains red. Next: run the newly added session-context/tool-registry tests, finish Server tests, review the exact diff, commit, and open the PR.

  10. dezren39 commented on Nov 7, 2026

    @dezren39
    Author

    Completed implementation and opened PR #1906: #1906 (open, not merged; target main). The API accepts detached: true; it is persisted and visible in Session.Info, inherited through children/forks/subagents, and the question tool is hidden by effective name with an explicit stale-call route-around error.

    Checks: bun run check passed (36 tasks); focused detached permission/toolset/stale-call/context/create/fork/subagent tests passed; detached session-create API test passed; Client 281, Schema 108, and Protocol 9 tests passed; Core migration and Protocol OpenAPI generated checks passed. Full Core and Server suites were attempted but had timeouts and were stopped, so this PR remains open under the local test merge gate. No follow-up or design-amendment issues filed; no open questions.

  11. dezren39 commented on Nov 7, 2026

    @dezren39
    Author

    Status (fleet feature wave, 2026-11-06 evening): PR #1906 is OPEN — feat(core): add detached session mode (29 files, +492/-16).

    What it does, per the PR: detached: true on session creation, persisted in session info/events and the generated clients/OpenAPI; the mode is inherited through child sessions, forks, and subagent launches; question is excluded from detached tool snapshots even if a plugin remaps its permission action, and stale calls receive explicit route-around guidance before hooks/forms run.

    Verification: the session reports bun run check passed (36 tasks) and the focused suites green (permission denial, toolset filtering, create/inheritance/fork, stale-call error, subagent propagation; Client 281, Schema 108, Protocol 9; server detached API test). The minder independently re-ran the two most on-point files in the worktree — test/tool-question.test.ts + test/session-create.test.ts: 55 pass, 0 fail.

    Left open deliberately (the session's call, minder concurs): the FULL Core and Server suites did not complete locally — the Core run hit multiple timeouts and was stopped after 22m49s; the Server run had three unrelated timeouts and was stopped after 2m43s. That was under heavy parallel load (four streams building at once), so the timeouts are inconclusive rather than failures. Merge should follow one calm full-suite pass over packages/core and packages/server; everything else about the PR is ready.

    Process note: this stream took three sessions — the first two (specialist route, claude-sonnet-5-5) stalled in the empty-completion pattern now filed as #1903; the third (workhorse route) adopted the first session's uncommitted work and finished it. #1885 stays open until #1906 merges.

  12. added
    queue/queuedHas a queued task in the Supabase agent queue
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 7, 2026
  13. added
    work/assignedAn agent holds this item via the queue (claimed task)
    queue/claimedA queue worker has claimed the task for this item
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 8, 2026
  14. developing-today commented on Nov 8, 2026

    @developing-today

    🤖 Agent note · picked up

  15. developing-today commented on Nov 8, 2026

    @developing-today

    🤖 Agent note · done

  16. removed
    queue/claimedA queue worker has claimed the task for this item
    work/assignedAn agent holds this item via the queue (claimed task)
    on Nov 8, 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

    effort/mMedium: expected under 1 day of workkind/featureNew feature or capability requestmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/highImportant and time-sensitivesource/humanFiled directly by a humantask/triageQueue packet kind: verify, reproduce, and route this item

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions