Skip to content

Conversation

@continue-development-app
Copy link

@continue-development-app continue-development-app bot commented Dec 24, 2025

This PR adds comprehensive test coverage for the refactoring introduced in PR #9285.

Test Coverage

Added 70+ test cases covering:

Backward Compatibility

  • ✅ Old signature with history array
  • ✅ Correct behavior when passed array vs options object

New Functionality

  • ✅ New interface
  • ✅ flag tracking
  • ✅ calculation based on diff stats

Core Features

  • ✅ Diff stats collection ()
  • ✅ Summary extraction ()
  • ✅ Session usage collection ()
  • ✅ Metadata posting logic

Edge Cases & Error Handling

  • ✅ Missing agent ID handling
  • ✅ Empty/undefined history
  • ✅ Git diff errors
  • ✅ API errors
  • ✅ Zero vs positive changes
  • ✅ Partial metadata scenarios

Integration Tests

  • ✅ Full metadata collection with all fields
  • ✅ Partial metadata with some fields missing
  • ✅ Different completion states

Key Test Scenarios

  1. isComplete flag behavior: Ensures that when , both and are included in metadata
  2. Backward compatibility: Old code calling continues to work
  3. hasChanges calculation: Correctly determined based on additions/deletions
  4. Error resilience: All collection functions fail gracefully without throwing

Test File

    • 627 lines of comprehensive tests

Why These Tests Matter

The refactoring in PR #9285 introduced:

  • New interface with completion tracking
  • Split logic into testable helper functions
  • Backward compatibility layer

These tests ensure:

  • ✅ No regressions in existing behavior
  • ✅ New features work as expected
  • ✅ Edge cases are handled properly
  • ✅ Code is maintainable going forward

This task was co-authored by peter-parker and Continue.


Summary by cubic

Adds comprehensive tests and finalizes the updateAgentMetadata refactor from PR #9285. Introduces an options-based API with completion tracking, and updates CLI shutdown to send a final isComplete=true metadata update.

  • Refactors
    • Add UpdateAgentMetadataOptions (history, isComplete) while keeping old history[] signature.
    • Track isComplete and hasChanges (from git diff stats) in posted metadata.
    • Extract helpers for diff, summary, and session usage; handle errors gracefully.
    • Round totalCost to 6 decimals and include cached/cacheWrite token details when present.
    • CLI serve: call updateAgentMetadata({ history, isComplete: true }) on exit.
    • Add 70+ tests covering backward compatibility, diff stats, summary extraction, usage, error handling, and posting logic.

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

sestinj and others added 2 commits December 23, 2025 21:39
- Add 70+ test cases covering all scenarios in PR #9285
- Test backward compatibility with old signature (history array)
- Test new signature with UpdateAgentMetadataOptions
- Test isComplete flag and hasChanges tracking
- Test diff stats, summary, and usage collection
- Test error handling and edge cases
- Test metadata posting logic
- Test integration scenarios with all metadata fields

Co-authored-by: peter-parker <e2e@continue.dev>

Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <noreply@continue.dev>
@continue-development-app continue-development-app bot requested a review from a team as a code owner December 24, 2025 02:58
@continue-development-app continue-development-app bot requested review from Patrick-Erichsen and removed request for a team December 24, 2025 02:58
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Dec 24, 2025
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.

No issues found across 3 files

@continue
Copy link
Contributor

continue bot commented Dec 24, 2025

Documentation Review

I've reviewed PR #9289 and determined that no documentation updates are required.

Rationale

This PR adds comprehensive test coverage for internal refactoring work (from PR #9285). The changes are:

  • Internal refactoring only: The updateAgentMetadata function is an internal implementation detail in the CLI
  • Backward compatible: The old signature (passing history array) still works alongside the new options-based signature
  • No user-facing changes: No new CLI flags, commands, or user-facing features
  • Test-only additions: 627 lines of tests for existing functionality

Current Documentation Status

The existing documentation remains accurate:

  • docs/guides/cli.mdx - Still correctly describes CLI usage
  • extensions/cli/docs/artifact-uploads.md - Unaffected by these changes
  • Agent metadata tracking is an internal mechanism, not a documented user feature

Conclusion: No documentation PR needed. The test additions improve code quality without requiring user-facing documentation updates.

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

Labels

continue-agent 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