Skip to content

#68: Cockpit mode — Slice B: autonomous cockpit (detached /afk + monitor)#70

Merged
lsfera merged 1 commit into
mainfrom
agent/issue-68
Jun 28, 2026
Merged

#68: Cockpit mode — Slice B: autonomous cockpit (detached /afk + monitor)#70
lsfera merged 1 commit into
mainfrom
agent/issue-68

Conversation

@lsfera

@lsfera lsfera commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Closes #68

Implemented autonomously by the AFK orchestrator in an isolated, git-isolated sandbox.

Commits: db3ab0b

Add a pure TypeScript `resolveRunMode(env)` function that returns
'detached' when AGENTIC_IN_CONTAINER is set (cockpit) and 'foreground'
otherwise. The launcher (run.sh) stays thin — it always execs tsx main.ts
and the TypeScript entrypoint owns the decision.

When cockpit mode is detected, `main()` calls `detachAndRelaunch()` which:
- spawns the orchestrator as a detached background process (detached: true,
  stdio piped to .sandcastle/logs/<mode>-<ts>.log)
- strips AGENTIC_IN_CONTAINER from the child's env so it resolves
  'foreground' and runs the orchestrator loop normally
- writes the PID to .sandcastle/<mode>.pid
- prints tail/stop instructions and returns, freeing the cockpit session

Host-driven /afk and /hitl are unaffected (resolveRunMode → 'foreground').

Docs: CLAUDE.md's cockpit section now covers kick off, monitor, and stop.
Unit tests cover all four resolveRunMode cases (detached / foreground /
empty-string / any-truthy-value).
@lsfera lsfera enabled auto-merge (squash) June 28, 2026 10:37
@lsfera lsfera merged commit 49938ab into main Jun 28, 2026
3 checks passed
@lsfera lsfera deleted the agent/issue-68 branch June 28, 2026 10:37
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.

Cockpit mode — Slice B: autonomous cockpit (detached /afk + monitor)

1 participant