-
Notifications
You must be signed in to change notification settings - Fork 4k
feat: Add Event tool for reporting activity to task timeline #9340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Adds the ability for agents to report activity events to the control plane: - Add src/util/events.ts with postAgentEvent() function - Add src/tools/event.ts with Event tool for agents - Register Event tool in allBuiltIns.ts and index.tsx - Event tool is only available when running in agent mode (--id flag) Supported event types: pr_created, comment_posted, commit_pushed, issue_closed, review_submitted (and custom event names) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Learn moreAll Green is an AI agent that automatically: ✅ Addresses code review comments ✅ Fixes failing CI checks ✅ Resolves merge conflicts |
1 similar comment
Learn moreAll Green is an AI agent that automatically: ✅ Addresses code review comments ✅ Fixes failing CI checks ✅ Resolves merge conflicts |
|
✅ Review Complete Code Review SummaryTroubleshooting
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found across 4 files
|
📚 Documentation Update I've created PR #9341 with documentation for the new Event tool. The documentation covers:
The docs follow the same pattern as the existing |
Instead of requiring the agent to manually call an Event tool (which is unreliable), events are now emitted automatically when specific GitHub CLI commands succeed: - pr_created: gh pr create - comment_posted: gh pr comment, gh issue comment - commit_pushed: git push - issue_closed: gh issue close - review_submitted: gh pr review Added command detection functions and output parsers to extract event details (PR numbers, URLs, etc.) from command output. Events are posted non-blocking to the control plane when an agent ID is present. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Adds detection and event emission for gh api commands used in agent prompts: - comment_reply_posted: gh api -X POST repos/.../pulls/.../comments/.../replies - review_thread_resolved: gh api graphql ... resolveReviewThread These patterns match the exact commands we instruct agents to use in agentPrompts.ts for replying to PR review comments and resolving threads. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Adds comprehensive tests for: - Command detection functions (isGitCommitCommand, isPullRequestCommand, isCommentCommand, isGitPushCommand, isIssueCloseCommand, isReviewCommand, isCommentReplyCommand, isResolveThreadCommand) - Event parsing functions (parsePrCreatedOutput, parseCommentOutput, parseGitPushOutput, parseIssueCloseOutput, parseReviewOutput, parseCommentReplyOutput, parseResolveThreadOutput) 76 tests covering edge cases, case insensitivity, and various command formats. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 issue found across 2 files (changes from recent commits).
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="extensions/cli/src/telemetry/utils.test.ts">
<violation number="1" location="extensions/cli/src/telemetry/utils.test.ts:228">
P2: Test name contradicts the assertion. The test is named "should not match unresolveReviewThread" but asserts `toBe(true)`. Consider renaming to something like "documents that unresolveReviewThread also matches due to substring" to accurately reflect the test's purpose, or fix the implementation if the intended behavior is to exclude unresolveReviewThread.</violation>
</file>
Reply to cubic to teach it or ask questions. Tag @cubic-dev-ai to re-run a review.
| expect(isResolveThreadCommand(cmd)).toBe(true); | ||
| }); | ||
|
|
||
| it("should not match unresolveReviewThread", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: Test name contradicts the assertion. The test is named "should not match unresolveReviewThread" but asserts toBe(true). Consider renaming to something like "documents that unresolveReviewThread also matches due to substring" to accurately reflect the test's purpose, or fix the implementation if the intended behavior is to exclude unresolveReviewThread.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At extensions/cli/src/telemetry/utils.test.ts, line 228:
<comment>Test name contradicts the assertion. The test is named "should not match unresolveReviewThread" but asserts `toBe(true)`. Consider renaming to something like "documents that unresolveReviewThread also matches due to substring" to accurately reflect the test's purpose, or fix the implementation if the intended behavior is to exclude unresolveReviewThread.</comment>
<file context>
@@ -0,0 +1,244 @@
+ expect(isResolveThreadCommand(cmd)).toBe(true);
+ });
+
+ it("should not match unresolveReviewThread", () => {
+ // This tests that we're matching resolveReviewThread specifically
+ // unresolveReviewThread also contains resolveReviewThread as a substring
</file context>

Adds the ability for agents to report activity events to the control plane:
Supported event types: pr_created, comment_posted, commit_pushed, issue_closed, review_submitted (and custom event names)
🤖 Generated with Claude Code
Description
[ What changed? Feel free to be brief. ]
AI Code Review
@continue-reviewChecklist
Screen recording or screenshot
[ When applicable, please include a short screen recording or screenshot - this makes it much easier for us as contributors to review and understand your changes. See this PR as a good example. ]
Tests
[ What tests were added or updated to ensure the changes work as expected? ]
Summary by cubic
Automatically emits activity events to the task timeline when agents run GitHub CLI and git commands. Improves visibility of PRs, comments, commits, issue closures, and reviews without requiring manual tool calls.
Written for commit d7ca766. Summary will update automatically on new commits.