Skip to content

Conversation

@sestinj
Copy link
Contributor

@sestinj sestinj commented Nov 22, 2025

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.

  • New Features
    • Added utilities: calculateDiffStats, extractSummary, getAgentIdFromArgs, postAgentMetadata.
    • Serve calls updateAgentMetadata after each agent turn and before graceful exit; failures are non-blocking and logged.
    • Metadata includes additions/deletions from current repo diff and the last assistant message (trimmed).
    • Added unit tests for metadata utilities.

Written for commit a1f1d55. Summary will update automatically on new commits.

@sestinj sestinj requested a review from a team as a code owner November 22, 2025 00:19
@sestinj sestinj requested review from RomneyDa and removed request for a team November 22, 2025 00:19
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Nov 22, 2025
@github-actions
Copy link

⚠️ PR Title Format

Your PR title doesn't follow the conventional commit format, but this won't block your PR from being merged. We recommend using this format for better project organization.

Expected Format:

<type>[optional scope]: <description>

Examples:

  • feat: add changelog generation support
  • fix: resolve login redirect issue
  • docs: update README with new instructions
  • chore: update dependencies

Valid Types:

feat, fix, docs, style, refactor, perf, test, build, ci, chore, revert

This helps with:

  • 📝 Automatic changelog generation
  • 🚀 Automated semantic versioning
  • 📊 Better project history tracking

This is a non-blocking warning - your PR can still be merged without fixing this.

@github-actions
Copy link

github-actions bot commented Nov 22, 2025

✅ Review Complete

Code Review Summary

⚠️ Continue configuration error. Please verify that the assistant exists in Continue Hub.


Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a 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 `&quot;+++&quot;` 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(&quot;---&quot;)` 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("---") ||
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Nov 22, 2025

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(&quot;---&quot;)` 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(&quot;+++&quot;) ||
+      line.startsWith(&quot;---&quot;) ||
+      line.startsWith(&quot;@@&quot;) ||
+      line.startsWith(&quot;diff &quot;) ||
</file context>
Suggested change
line.startsWith("---") ||
line.startsWith("--- ") ||
Fix with Cubic

for (const line of lines) {
// Skip diff metadata lines (@@, +++, ---, diff, index, etc.)
if (
line.startsWith("+++") ||
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Nov 22, 2025

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 `&quot;+++&quot;` 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(&quot;+++&quot;) ||
+      line.startsWith(&quot;---&quot;) ||
+      line.startsWith(&quot;@@&quot;) ||
</file context>
Suggested change
line.startsWith("+++") ||
line.startsWith("+++ ") ||
Fix with Cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants