Repository navigation
[codex] Add runtime message bus - #93
Conversation
Runtime controls need cursor-based consumption before HTTP owner routing and subagent orchestration can build on the pipeline safely.
📝 WalkthroughWalkthroughThis PR adds a runtime message bus system to Agentkit, enabling asynchronous control messages ( ChangesRuntime Message Bus & Pipeline Integration
Sequence DiagramsequenceDiagram
actor Ext as External<br/>(Agent/Client)
participant Bus as RuntimeMessageBus
participant Pipe as Pipeline
participant LLM as LLM Model
Ext->>Bus: publish(RuntimeMessage)
activate Bus
Bus-->>Ext: SequencedRuntimeMessage
deactivate Bus
Pipe->>Pipe: run_turn() started
activate Pipe
Pipe->>Pipe: stage loop
Note over Pipe,Bus: At each stage boundary
Pipe->>Bus: consume_after(cursor)
activate Bus
Bus-->>Pipe: RuntimeMessageBatch
deactivate Bus
alt interrupt message received
Pipe->>Pipe: raise PipelineError
Note over Pipe: Turn fails, no model call
else normal messages
Pipe->>Pipe: _runtime_context_grounding()<br/>(build system message)
Pipe->>LLM: run(messages with runtime<br/>context grounding)
activate LLM
LLM-->>Pipe: response
deactivate LLM
end
deactivate Pipe
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Verification
uv run pytest tests/agentkit/runtime/test_runtime_messages.py tests/agentkit/runtime/test_pipeline.py -quv run pytest tests/agentkit/ -quv run pytest tests/coding_agent/test_pipeline_adapter.py tests/coding_agent/plugins/test_approval.py tests/integration/test_pipeline_e2e.py -q -k "not test_subagent_turn_persisted_tape_flows_into_eval_adapter"uv run basedpyright src/agentkit/runtime/messages.py src/agentkit/runtime/pipeline.py tests/agentkit/runtime/test_runtime_messages.py tests/agentkit/runtime/test_pipeline.py --level erroruv run python -m py_compile src/agentkit/runtime/messages.py src/agentkit/runtime/pipeline.py src/agentkit/runtime/__init__.py tests/agentkit/runtime/test_runtime_messages.py tests/agentkit/runtime/test_pipeline.pygit diff --checkKnown Existing Failure
tests/integration/test_pipeline_e2e.pystill includestest_subagent_turn_persisted_tape_flows_into_eval_adapter, which depends on the absentcoding-agent/data/eval/golden/parent-child-subagent-001.yamlfixture. The PR verification excludes that known fixture gap.