Remove backward-compatibility fallbacks for unknown agent types#515
Remove backward-compatibility fallbacks for unknown agent types#515squishykid merged 2 commits intomainfrom
Conversation
Agent type tracking was added 6 days after repo creation and shipped in v0.3.5. Remove DefaultAgentType, isSpecificAgentType, and the ResolveAgentForRewind fallback-to-default logic since no production sessions lack agent type info. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Entire-Checkpoint: 175ab37325b5
PR SummaryMedium Risk Overview
Written by Cursor Bugbot for commit 74fcb66. Configure here. |
There was a problem hiding this comment.
Pull request overview
This PR removes backward-compatibility fallbacks for sessions without agent type information, simplifying the codebase by eliminating dead code paths that were only needed for sessions created before agent type tracking was added (Jan 9, 2026 - 6 days after repo creation).
Changes:
- Removes
DefaultAgentTypeconstant andisSpecificAgentType()helper function that supported backward compatibility - Simplifies agent type resolution to fail fast instead of falling back to defaults
- Removes backfill logic that replaced unknown agent types with specific types
- Updates tests to expect errors for empty/unknown agent types instead of silent fallback behavior
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/entire/cli/strategy/common.go | Removes DefaultAgentType constant and isSpecificAgentType() helper; simplifies resolveAgentType() to return context value directly without fallback |
| cmd/entire/cli/strategy/manual_commit_rewind.go | Simplifies ResolveAgentForRewind() to call agent.GetByAgentType() directly, removing default agent fallback logic |
| cmd/entire/cli/strategy/manual_commit_hooks.go | Removes backfill logic that replaced "Agent" with real agent type; simplifies InitializeSession to only set agent type when empty (not when "Agent") |
| cmd/entire/cli/strategy/manual_commit_test.go | Removes TestInitializeSession_BackfillsUnknownAgentType test and updates comments to remove outdated bug reference |
| cmd/entire/cli/strategy/rewind_test.go | Updates TestResolveAgentForRewind to expect errors for empty agent types instead of defaulting to Claude |
…te-concept-agent-not-defined # Conflicts: # cmd/entire/cli/strategy/manual_commit_test.go
Summary
DefaultAgentTypeconstant andisSpecificAgentType()helper fromstrategy/common.goresolveAgentType()to use state or context agent type directly (no fallback to "Agent")ResolveAgentForRewind()to callagent.GetByAgentTypedirectly (no default-agent fallback)manual_commit_hooks.gothat replaced "Agent" with the real typeTestInitializeSession_BackfillsUnknownAgentTypetest and updateResolveAgentForRewindtestsAgent type tracking was added 6 days after repo creation (Jan 9, 2026) and shipped in v0.3.5 (Jan 15). There are no realistic production sessions without agent type info, so these backward-compat patterns just add complexity.
AgentTypeUnknownitself is kept — it's used in switch cases for format-detection (treating unknown transcripts as JSONL), which is correct behavior for old checkpoints.🤖 Generated with Claude Code