Field notes
2026-06-03 — Interactive sim against the live agent (`--real`)
What: The sim REPL can now drive the real AgentManager (live LLM) and renders a
claude-code-style feed instead of raw infra logs. Goal: chat with the agent through the
full gateway (gates, soul, MCP) without a Slack workspace.
Touchpoints#
config/env.ts— exportedloadDotenv(path)(was private). The sim forces an isolated temp$SLAUDE_HOME, so its.envnever loads the operator's creds;--realnow pulls a project-cwd.envexplicitly (no override of already-set process env).gateway/sim/cli.ts—--real(live agent) and--verbose/-v(restore infra logs) flags. Default quiet: mutesconsole.log/console.errorand rawprocess.stderr.writefor[mgr]/[agent-evt]/[slack-rx]/[stop-guard]… tagged lines (stop-guard writes straight to stderr, bypassing console).process.exit(0)after dispose — the REPL otherwise hangs on stdin EOF because SDK child / MCP handles keep the loop alive.gateway/sim/transport.ts—onCard(cb)fires per outbound card (live render + gate detection).gateway/sim/engine.ts— real agent usesAgentManager.#armTurn()arms adone/errorlistener before feeding (the turn is async — feedMessage returns before the reply lands), and also resolves when a permission/approval gate opens: a gate pauses the SDK turn awaiting a human click, so control returns to the REPL.pendingGate()+resolveGate(verb)click the open gate and await the continuation (which may stop at the next gate or finish).gateway/sim/repl.ts— live feed:🤖replies (assistantText / reply-tool, deduped),⏺ Tool(input)+⎿ resulttool activity,⚠️errors,🔒inline gate prompt. Barea/d/A(or allow/deny/always) answers an open gate. Reaction/message cards hidden (covered by the event stream). Stub path stays card-dump simple.
Real-behavior facts#
- OAuth tokens are short-lived. A
CLAUDE_CODE_OAUTH_TOKENminted viaclaude setup-tokenworked, then 401'd (Invalid authentication credentials · Please run /login) ~10 min later. The DeepSeek key in../deploy/.env.vaultis a dead placeholder (401 auth-fail). Sim wiring is cred-agnostic; supply a fresh token/key inslaude/.env. - Agent may stop without calling
reply. When it does, the Stop hook's stop-guard fires and anerr=successevent surfaces as a:warning:card — a pre-existing real-agent quirk, not sim wiring.
Deferred#
- Token-level streaming (events are per-block, not per-token).
- A real-mode transcript format (current
*.yamlscenarios assert stub-deterministic output; they mismatch under--real). Use the REPL for live interactive runs.