fix: use actual agent name instead of defaulting to "Agent"#164
Merged
Conversation
…oints
When InitializeSession failed or wasn't called before SaveChanges, the
manual-commit strategy fell back to DefaultAgentType ("Agent") instead
of using the agent type from SaveContext. This caused some checkpoints
to show "Agent" instead of "Claude Code" in metadata.
Three fixes:
- SaveChanges/SaveTaskCheckpoint now use ctx.AgentType via resolveAgentType()
- InitializeSession backfill now also corrects "Agent" default, not just empty
- Consolidated agent type resolution into isSpecificAgentType/resolveAgentType helpers
Fixes ENT-207
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: ada8171575ce
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug (ENT-207) where checkpoints sometimes displayed a generic "Agent" label instead of the actual agent name (e.g., "Claude Code") in metadata.json and the UI. The root cause was that SaveChanges and SaveTaskCheckpoint in the manual-commit strategy would fall back to DefaultAgentType ("Agent") when InitializeSession failed or wasn't called, even though the correct agent type was available in ctx.AgentType from the hook.
Changes:
- Introduces
resolveAgentType()andisSpecificAgentType()helper functions to prioritize agent types correctly - Updates
SaveChangesandSaveTaskCheckpointto use context agent type instead of blindly defaulting to "Agent" - Fixes
InitializeSessionto backfill sessions with the generic "Agent" value, not just empty values - Adds comprehensive regression tests covering all bug scenarios
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| cmd/entire/cli/strategy/common.go | Adds helper functions isSpecificAgentType() and resolveAgentType() to properly handle agent type resolution with correct priority |
| cmd/entire/cli/strategy/manual_commit_git.go | Updates SaveChanges and SaveTaskCheckpoint to use resolveAgentType() instead of manually defaulting to DefaultAgentType |
| cmd/entire/cli/strategy/manual_commit_hooks.go | Fixes InitializeSession backfill to replace both empty and "Agent" default values with correct agent type |
| cmd/entire/cli/strategy/manual_commit_test.go | Adds three regression tests: no session state, partial state, and backfill scenarios |
georg
previously approved these changes
Feb 8, 2026
Resolve conflict in manual_commit_git.go: keep resolveAgentType helper from this branch while adopting the new userPrompt parameter from main. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Entire-Checkpoint: 966462b9a8e7
Resolve conflict in manual_commit_hooks.go: keep isSpecificAgentType check from this branch while adopting LastInteractionAt tracking from main. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Entire-Checkpoint: de1b4494d570
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SaveChanges/SaveTaskCheckpointfell back toDefaultAgentType("Agent") whenInitializeSessionfailed or wasn't called, ignoring the correctctx.AgentTypefrom the hook agentInitializeSessionbackfill to correct existing sessions with "Agent" default, not just empty valuesTest plan
mise run test:ci)mise run lint)🤖 Generated with Claude Code
Note
Low Risk
Small, localized logic change to session metadata initialization/backfill with targeted regression tests; low blast radius but affects checkpoint metadata labeling.
Overview
Fixes cases where checkpoints were being labeled with the generic default agent by introducing shared agent-type selection helpers (preferring an existing specific stored type, then the hook-provided context type, then the default fallback).
Updates
ManualCommitStrategysession initialization paths (SaveChanges,SaveTaskCheckpoint, andInitializeSessionbackfill) to treatAgentTypeUnknown/"Agent" as non-specific and replace it when a real agent type is available. Adds regression tests covering no-state, partial-state, and backfill scenarios.Written by Cursor Bugbot for commit af4f21d. This will update automatically on new commits. Configure here.