Skip to content

Workers start without the supervisor's agent-session markers; act classes read as act - #94

Merged
hhff merged 1 commit into
mainfrom
worker-env-and-act-docs
Nov 4, 2026
Merged

hhff merged 1 commit into
mainfrom
worker-env-and-act-docs

Conversation

@hhff

@hhff hhff commented Nov 4, 2026

Copy link
Copy Markdown
Member

Two issues the Stacks supervisor reported after the move: its observations o-20261104-174501777 and o-20261104-185328718, both verified in its log.

What

  • scripts/devteam.mjs, worker/planner launch: the typed agent command is prefixed with env -u … for each agent-session marker found in this process's environment or tmux's global or session environment. SESSION_MARKERS matches CLAUDECODE, CLAUDE_CODE_* and CLAUDE_PID. Owner settings such as CLAUDE_CONFIG_DIR and CLAUDE_EFFORT aren't markers and stay. env -u works whatever the window's shell is (sh, zsh, fish). Both agent_command and resume_command are covered.
  • process/supervisor.md §3 step 8: the approval and ruling acts are written as act --class approve-spec --refs <id> (and likewise for approve-plan, contract-ruling and approve-design-change), not as commands of their own. The refusals the line describes are act's own checks (devteam.mjs cmdAct).
  • test/kit.test.mjs: the fleet-park test starts its new-machine worker from a supervisor environment carrying CLAUDECODE and CLAUDE_CODE_CHILD_SESSION, then asserts that the pane's command strips both and keeps CLAUDE_CONFIG_DIR.

Why

  • On the new machine, the supervisor created the devteam tmux server from inside its Claude Code session. Every worker inherited CLAUDE_CODE_CHILD_SESSION and the messaging-socket variables, so Claude Code treated each worker as a child session and saved no transcript. Spend went unmeasured until the supervisor unset the variables by hand and relaunched the three workers.
  • A supervisor following §3 literally ran devteam.mjs approve-spec and got "unknown command".

Authority

This adds no new path. It removes inherited variables from a worker's agent process, and the worker's role and policy still come from the DEVTEAM_* export and the --settings file, as before.

Harness-agnostic

The marker list names Claude Code's variables because those are the ones observed. Codex and OpenCode markers join SESSION_MARKERS as they're found. An unknown harness is unaffected.

Migration

None.

🤖 Generated with Claude Code

…sses read as act

A tmux server started from inside the supervisor's Claude Code session gave every window that
session's CLAUDECODE / CLAUDE_CODE_* markers, so workers ran as its children: no transcript, and
their spend went unmeasured. The worker and planner launch now strips the markers it sees in its
own environment and tmux's (env -u, whatever the window's shell). Settings an owner exports, such
as CLAUDE_CONFIG_DIR, stay.

supervisor.md §3 wrote approve-spec, approve-plan, contract-ruling and approve-design-change as if
they were commands; they are act classes: act --class <class> --refs <ticket>.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hhff

hhff commented Nov 4, 2026

Copy link
Copy Markdown
Member Author

Review (upstream loop, author's own PR):

  • Claims verified against the Stacks log (o-20261104-174501777, o-20261104-185328718) and the kit. cmdAct holds the refusals that supervisor.md §3 describes; no approve-* command exists.
  • Authority: this only removes inherited variables from a worker's agent process. Role and policy still come from the DEVTEAM_* export and --settings. No path to the owner.
  • env -u is shell-independent. Owner settings (CLAUDE_CONFIG_DIR) are kept, and the test asserts it.
  • Tests: CI 18/20/22/24 green; local Node 24.14.1 42/42.

@hhff
hhff merged commit bf584de into main Nov 4, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant