docs: add Agent Runtime abstraction discovery document#4
Closed
docs: add Agent Runtime abstraction discovery document#4
Conversation
sync fork w/upstream
Comprehensive analysis of the current pi-embedded agent architecture to support a secondary agent runtime (Claude Agent SDK). Includes: - Full event emission map (lifecycle, tool, assistant, compaction streams) - Callback propagation flow from CLI/gateway to subscription layer - Generalizable properties across agent runtimes - Tool system architecture analysis - Proposed adapter pattern for minimal-invasion multi-runtime support - Flow diagrams for request-to-execution and callback threading https://claude.ai/code/session_019VLYcDmUS6qGyDngUDoT7K
Focused implementation document based on the single entry point diverter approach validated in AGENT_RUNTIME_DISCOVERY.md. Key points: - runEmbeddedPiAgent() is THE single conflict point (5-line diverter) - Same params in, same callbacks invoked, same events emitted, same result out - Claude SDK adapter lives in isolated claude-sdk-adapter/ package - Reuses existing createOpenClawCodingTools() for tool creation - Includes concrete code examples for loop, tools, and event emission - Migration checklist and testing strategy https://claude.ai/code/session_019VLYcDmUS6qGyDngUDoT7K
Explicitly documents why the single entry point approach works: - Callbacks are dependency-injected via params, not hardcoded - Upstream event emissions are wrapper events (before/after the call) - The diverter receives everything it needs in params This captures the key insight from validating that run.ts is the only conflict point. https://claude.ai/code/session_019VLYcDmUS6qGyDngUDoT7K
dgarson
added a commit
that referenced
this pull request
Feb 2, 2026
dgarson
added a commit
that referenced
this pull request
Feb 7, 2026
…#208) * feat: added work-queue workflow workers and a worker manager, integrate w/cron * fix: address 12 logic flaws in workflow engine, adapter, phases, and cron types - engine: capture phase before clobbering in catch handler (#1) - engine: remove dead `state.plan ?? plan` fallback (#2) - engine: mark workflow failed when all execution nodes fail (#6) - adapter: fix retry count off-by-one (attemptNumber vs retryCount) (#3) - adapter: clean up abort listener in sleep on timeout (#10) - discover: fix batch/entries index mismatch when spawns fail (#4) - execute: add cycle detection to topological sort (#5) - review: add autoApproved flag to distinguish fallback approvals (#7) - plan: add comment clarifying sessionKey reuse across repair attempts (#8) - decompose: remove unused model/maxPhases/maxTasksPerPhase/maxSubtasksPerTask opts (#9) - types: add autoApproved to ReviewIteration (#7) - cron/state: use discriminated union for CronEvent (CronJobEvent | CronHealthEvent) (#12) - tests: add WorkflowWorkerAdapter test suite (8 tests) (#11) https://claude.ai/code/session_01L8kquwpmUh5zmU9S4MHgPu --------- Co-authored-by: Claude <[email protected]>
dgarson
added a commit
that referenced
this pull request
Feb 7, 2026
…cron types (openclaw#217) - engine: capture phase before clobbering in catch handler (#1) - engine: remove dead `state.plan ?? plan` fallback (#2) - engine: mark workflow failed when all execution nodes fail (#6) - adapter: fix retry count off-by-one (attemptNumber vs retryCount) (#3) - adapter: clean up abort listener in sleep on timeout (#10) - discover: fix batch/entries index mismatch when spawns fail (#4) - execute: add cycle detection to topological sort (#5) - review: add autoApproved flag to distinguish fallback approvals (#7) - plan: add comment clarifying sessionKey reuse across repair attempts (#8) - decompose: remove unused model/maxPhases/maxTasksPerPhase/maxSubtasksPerTask opts (#9) - types: add autoApproved to ReviewIteration (#7) - cron/state: use discriminated union for CronEvent (CronJobEvent | CronHealthEvent) (#12) - tests: add WorkflowWorkerAdapter test suite (8 tests) (#11) https://claude.ai/code/session_01L8kquwpmUh5zmU9S4MHgPu Co-authored-by: Claude <[email protected]>
Owner
Author
|
Superseded by completed AgentRuntime/ExecutionKernel refactor (Phases 1-9 all merged). |
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.
Comprehensive analysis of the current pi-embedded agent architecture to support a secondary agent runtime (Claude Agent SDK).
Includes:
https://claude.ai/code/session_019VLYcDmUS6qGyDngUDoT7K