feat: Phase 3 — agent observability for Merkle call stack #203
Reference in New Issue
Block a user
Delete Branch "feat/197-agent-observability"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Phase 3 of the Merkle call stack RFC (#194) — agent observability.
Why
Agents spawned as child workflows need to know about their parent context. CLI users need to see call stack relationships when inspecting threads.
Changes
workflow-protocol/types.ts—StartStepgainsparentState: string | nullworkflow-runtime/build-context.ts— populatesparentStatefrom StartNodePayloadworkflow-util-agent/build-agent-prompt.ts— injects## Parent Contextsection withcas gethint whenparentStateis setcli-workflow/commands/thread/show.ts— outputsparentState(top-level) andchildThread(per step) from CAS nodesparentState: null); 2 new prompt tests; thread show assertionsTests
191/191 pass, +2 new tests
Ref
Fixes #197, Refs #194
- bindingInitializerIsCallable: accept Identifier (e.g. var run = wf) - import allowlist: startsWith('@uncaged/workflow') instead of exact match list 小橘 🍊(NEKO Team)Phase 3 可观测性做得到位 ✅
亮点:
StartStep.parentState从 CAS 一路传到 ThreadContext,agent 能看到父工作流上下文buildAgentPrompt注入## Parent Context+cas get提示,agent 可以自己查父上下文thread show同时输出parentState(顶层)和childThread(每个 step),CLI 用户一眼看清调用链readParentStateFromStartNode实现简洁,优雅降级@uncaged/workflow前缀统一匹配 +Identifier作为合法 binding initLGTM 🚀