Instrument Agent completion signals - #950
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthroughAgent completion signals now track steps, tool failures, todo status, and natural stops across chat and trigger runs. The resulting metrics flow through stream context into completion analytics and PostHog agent-run events, with tests covering calculation, serialization, and event mapping. ChangesCompletion signal telemetry
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant ChatHandler
participant AgentStreamRunner
participant AgentCompletionSignalTracker
participant ChatLogger
ChatHandler->>AgentCompletionSignalTracker: create tracker and record handled tool failures
ChatHandler->>AgentStreamRunner: pass tracker in stream context
AgentStreamRunner->>AgentCompletionSignalTracker: record completed step content
ChatHandler->>ChatLogger: send built completion signals
ChatLogger-->>ChatHandler: capture hackerai-agent_run event
Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
CodeRabbit's generic docstring-coverage warning is non-blocking and not applicable as a change request here: the repository does not enforce docstring coverage for TypeScript helpers, the exported APIs are fully typed, and the two state transitions whose intent is not obvious already have focused comments. Adding boilerplate docstrings would not improve the correctness or privacy auditability of this telemetry change. |
Summary
hackerai-agent_runevent with versioned, content-free Agent completion signalsstopfrom limits, errors, and abortsPrivacy
The new properties contain counts and booleans only. They do not include prompts, todo text, tool names, tool inputs, tool outputs, errors, code, targets, findings, or evidence.
Why
This gives us a baseline for deciding whether premature natural stops justify a narrowly scoped one-shot stop veto. It does not change Agent behavior.
Validation
pnpm typecheckSummary by CodeRabbit
New Features
Privacy
Tests