fix(phase-16/03): ACP audit trail was always empty - #357
Open
thejesh23 wants to merge 1 commit into
Open
Conversation
docs/en.md says every agent execution produces an audit entry with the complete
trajectory of tool calls in between, and the gateway wraps the execution in that
trail. The demo printed 'Trajectory steps: 0' and 'Artifacts: 0'.
Two causes, both needed: sendMessage fired processTask without awaiting, so it
returned before the handler ran; and delegateTask ran auditRunner.run before
dispatching, so structuredClone(result.trajectory) snapshotted an array the
handler had not filled yet.
Await the handler, and audit after dispatch.
Task state: completed
Artifacts: 1
Trajectory steps: 2
- Searching for React 19 documentation Tool: web_search
- Extracting key findings from search results Tool: doc_analysis
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe communication protocol example now awaits task processing before failure handling and sends delegated tasks before running audits, while preserving the existing delegation result structure. ChangesCommunication protocol flow
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
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.
What this PR does
The ACP audit trail in the protocol capstone was always empty, so the section of the demo that exists to show it printed nothing.
Kind of change
Checklist
docs/en.mdclaimsPhase / lesson
Phase 16 · 03-communication-protocols
Detail
docs/en.mdsays every agent execution produces a full audit entry with "the complete trajectory of tool calls and reasoning steps in between", and that the gateway wraps the execution in an audit trail with trajectory.Two causes, both required:
sendMessagefiredthis.processTask(...)without awaiting, so it returned before the handler ran.delegateTaskcalledauditRunner.run(...)before dispatching, sostructuredClone(result.trajectory)snapshotted an array the handler had not filled yet.Before:
After — await the handler, and audit after dispatch:
Verified with
node --experimental-strip-types code/main.ts; the script exits 0 and the other sections are unchanged. Fixing only one of the two leavesTrajectory steps: 0.