SENPAI Console integration + Phase 2 steer/watch hooks - #3468
Draft
morganmcg1 wants to merge 1 commit into
Draft
Conversation
Coordinated change-set so the SENPAI Console (wandb/senpai-console) can index this fleet and steer agents near-live. Additive and inert by default — nothing changes unless the new env vars are set. Implemented for the real Claude-Code runtime (this fleet runs `claude`, not an OpenHands agent-server). - Markers (P0-S2): advisor writes SENPAI-EXP (lineage/queue/taste) + SENPAI-ADVISOR (heartbeat status); student note that the experiment id comes from SENPAI-EXP. - system_instructions/CLAUDE-SUPERVISOR.md: the console's control agent role. - Live event mirroring: run-senpai-claude.sh mirrors stream-json to $SENPAI_EVENT_DIR/event-*.jsonl when set, for reliable console ingestion. - Console -> agent inbox: k8s/senpai-console-inbox.sh (senpai_drain_inbox); the advisor/student entrypoints drain $SENPAI_CONSOLE_INBOX_DIR directives into the next heartbeat's prompt (near-live steer) and archive them; an inbox directive also wakes the advisor when nothing else is actionable. - launch.py: --event_dir / --console_inbox_dir threaded into both ConfigMaps. - Docs: CONSOLE-INTEGRATION.md; unit test k8s/test-senpai-console-inbox.sh. Verified: bash -n on all scripts, the inbox unit test passes, and `python k8s/launch.py --dry_run` renders the new keys into every ConfigMap. Not cluster-tested — verify on a scratch tag before relying on it. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Coordinated change-set so the SENPAI Console (see its PR #1) can index this fleet and steer agents near-live. Everything is additive and inert by default — nothing changes unless the new env vars are set.
Runtime reality
The console build plan frames Phase 2 around an OpenHands
openhands-agent-server(Surface B). This fleet runs Claude Code (k8s/run-senpai-claude.sh), not OpenHands — there is nosenpai_agent/openhands_runner.pyonmain. So Phase 2 is implemented in terms of the real Claude-Code runtime:SENPAI_EVENT_DIR— mirror Claude Code--output-format stream-jsonto a stable per-iteration event file the console tailssend_message()mid-run steerSENPAI_CONSOLE_INBOX_DIR— console drops a directive file; the entrypoint drains it into the next heartbeat's promptpause/interruptclaude -p; watchdogs + GitHub-mediated controls remainWhat changed (additive / inert by default)
SENPAI-EXP(lineage/queue/taste) +SENPAI-ADVISOR(heartbeat status); student note that the experiment id comes fromSENPAI-EXP. Single-line valid JSON; the console degrades loudly on malformed markers.system_instructions/CLAUDE-SUPERVISOR.md: the console's control-agent role. It runs in the console backend today; an in-fleet pod is a documented future option.k8s/run-senpai-claude.shmirrors stream-json to$SENPAI_EVENT_DIR/event-*.jsonlwhen set.k8s/senpai-console-inbox.sh(senpai_drain_inbox); advisor/student entrypoints drain$SENPAI_CONSOLE_INBOX_DIRdirectives into the next prompt under a# Console directivesheader and archive them. An inbox directive also wakes the advisor when nothing else is actionable.k8s/launch.py:--event_dir/--console_inbox_dirthreaded into both ConfigMaps (default empty = disabled).CONSOLE-INTEGRATION.md.Enable
Leave both unset to keep the fleet exactly as it is today.
Verification
bash k8s/test-senpai-console-inbox.sh— unit-testssenpai_drain_inbox(inert-when-unset, drains+archives, second drain empty). Passes.bash -nclean on all modified scripts.python k8s/launch.py --dry_run true …rendersSENPAI_EVENT_DIR/SENPAI_CONSOLE_INBOX_DIRinto every ConfigMap.Draft because
The entrypoint wiring + event mirroring are additive and inert, but not cluster-tested. Verify on a scratch tag before relying on them. Marked draft pending that check.
🤖 Generated with Claude Code