-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Add agent session metadata tracking and reporting to control plane #8838
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
|
|
✅ Review Complete Code Review Summary |
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.
2 issues found across 4 files
Prompt for AI agents (all 2 issues)
Understand the root cause of the following 2 issues and fix them.
<file name="extensions/cli/src/util/metadata.ts">
<violation number="1" location="extensions/cli/src/util/metadata.ts:37">
`calculateDiffStats` skips legitimate additions whose content starts with `++` because the metadata filter treats any line beginning with `"+++"` as a header, so diff lines like `+++counter;` (an added `++counter;`) are ignored and the addition count becomes inaccurate.</violation>
<violation number="2" location="extensions/cli/src/util/metadata.ts:38">
Deletions of lines starting with `--` (or `---`) are treated as metadata due to the `line.startsWith("---")` check, so diff lines such as `---counter;`—which represent a real removal of `--counter;`—are skipped and the deletion count under-reports the true change size.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
| // Skip diff metadata lines (@@, +++, ---, diff, index, etc.) | ||
| if ( | ||
| line.startsWith("+++") || | ||
| line.startsWith("---") || |
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.
Deletions of lines starting with -- (or ---) are treated as metadata due to the line.startsWith("---") check, so diff lines such as ---counter;—which represent a real removal of --counter;—are skipped and the deletion count under-reports the true change size.
Prompt for AI agents
Address the following comment on extensions/cli/src/util/metadata.ts at line 38:
<comment>Deletions of lines starting with `--` (or `---`) are treated as metadata due to the `line.startsWith("---")` check, so diff lines such as `---counter;`—which represent a real removal of `--counter;`—are skipped and the deletion count under-reports the true change size.</comment>
<file context>
@@ -0,0 +1,167 @@
+ // Skip diff metadata lines (@@, +++, ---, diff, index, etc.)
+ if (
+ line.startsWith("+++") ||
+ line.startsWith("---") ||
+ line.startsWith("@@") ||
+ line.startsWith("diff ") ||
</file context>
| line.startsWith("---") || | |
| line.startsWith("--- ") || |
| for (const line of lines) { | ||
| // Skip diff metadata lines (@@, +++, ---, diff, index, etc.) | ||
| if ( | ||
| line.startsWith("+++") || |
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.
calculateDiffStats skips legitimate additions whose content starts with ++ because the metadata filter treats any line beginning with "+++" as a header, so diff lines like +++counter; (an added ++counter;) are ignored and the addition count becomes inaccurate.
Prompt for AI agents
Address the following comment on extensions/cli/src/util/metadata.ts at line 37:
<comment>`calculateDiffStats` skips legitimate additions whose content starts with `++` because the metadata filter treats any line beginning with `"+++"` as a header, so diff lines like `+++counter;` (an added `++counter;`) are ignored and the addition count becomes inaccurate.</comment>
<file context>
@@ -0,0 +1,167 @@
+ for (const line of lines) {
+ // Skip diff metadata lines (@@, +++, ---, diff, index, etc.)
+ if (
+ line.startsWith("+++") ||
+ line.startsWith("---") ||
+ line.startsWith("@@") ||
</file context>
| line.startsWith("+++") || | |
| line.startsWith("+++ ") || |
Summary by cubic
Adds agent session metadata tracking to the control plane. Collects git diff stats and a short conversation summary, sent after each turn and on shutdown.
Written for commit a1f1d55. Summary will update automatically on new commits.