Skip to content

Comments

docs: add Agent Runtime abstraction discovery document#4

Closed
dgarson wants to merge 7 commits intomainfrom
claude/agent-runtime-abstraction-QySU9
Closed

docs: add Agent Runtime abstraction discovery document#4
dgarson wants to merge 7 commits intomainfrom
claude/agent-runtime-abstraction-QySU9

Conversation

@dgarson
Copy link
Owner

@dgarson dgarson commented Jan 31, 2026

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

dgarson and others added 7 commits January 26, 2026 18:12
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]>
@dgarson
Copy link
Owner Author

dgarson commented Feb 7, 2026

Superseded by completed AgentRuntime/ExecutionKernel refactor (Phases 1-9 all merged).

@dgarson dgarson closed this Feb 7, 2026
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.

2 participants