fix: use Unknown instead of Claude Code for unidentified agent fallback#838
Merged
peyton-alt merged 5 commits intomainfrom Apr 3, 2026
Merged
fix: use Unknown instead of Claude Code for unidentified agent fallback#838peyton-alt merged 5 commits intomainfrom
peyton-alt merged 5 commits intomainfrom
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes agent attribution fallbacks so sessions/checkpoints that can’t be confidently attributed to a single agent display as Unknown (instead of incorrectly showing Claude Code), and improves fallback detection when multiple agent config directories coexist.
Changes:
- Update
AgentTypeUnknowndisplay string from"Agent"to"Unknown"and adjust commit message fallback expectation. - Adjust
ReadAgentTypeFromTreefallback logic to return a specific agent only when exactly one agent marker is detected; otherwise return Unknown. - Add unit tests for
ReadAgentTypeFromTreecovering single-agent, multi-agent, andmetadata.jsonoverride scenarios.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/entire/cli/strategy/read_agent_from_tree_test.go | Adds targeted unit tests for tree-based agent type detection and metadata override behavior. |
| cmd/entire/cli/strategy/common.go | Updates fallback detection to avoid misattribution when multiple agent config markers exist. |
| cmd/entire/cli/commit_message_test.go | Updates expected commit message fallback text to “Unknown session updates”. |
| cmd/entire/cli/agent/registry.go | Changes the unknown agent type label to “Unknown”. |
| cmd/entire/cli/agent/registry_test.go | Clarifies the intent of DefaultAgentName (setup UX, not attribution fallback). |
acca87c to
22b5950
Compare
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Entire-Checkpoint: f2e246b13aa1
…xist Previously, .claude/ directory presence always returned AgentTypeClaudeCode, even when other agent config dirs (e.g., .codex/) coexisted from 'entire configure'. Now counts detected agent dirs and returns Unknown when ambiguous. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Entire-Checkpoint: 45a6a07753e8
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Entire-Checkpoint: fe6c491e7122
Addresses PR review feedback: - Add .factory dir detection for Factory AI Droid (Cursor Bugbot) - Add single-agent tests for Codex, Cursor, Factory (Copilot) - Update comment to say "config markers" not "config dir" (Copilot) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Entire-Checkpoint: 0372b92d6beb
No need for a standalone test file — these tests belong with the function they test in common.go. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Entire-Checkpoint: 751884f8707a
22b5950 to
f168d06
Compare
computermode
approved these changes
Apr 3, 2026
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
AgentTypeUnknownfrom"Agent"to"Unknown"so unidentified agents display correctlyReadAgentTypeFromTreeto return Unknown when multiple agent config dirs exist (e.g.,.claude/+.codex/fromentire configure)DefaultAgentName(Claude Code) is for setup UX, not attribution fallbackContext
Users reported seeing "Claude Code" in
entire statusand commit messages when using other agents (Codex, Cursor). The root cause: when the CLI can't determine which agent created a checkpoint, it was falling back to Claude Code instead of Unknown. This happened inReadAgentTypeFromTreewhich checked for.claude/directory presence — butentire configureinstalls config dirs for all selected agents, so.claude/existing doesn't mean Claude Code was the agent.Test plan
ReadAgentTypeFromTreecovering single-agent, multi-agent, and metadata.json scenariosmise run fmt && mise run lint && mise run test:ciall pass🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com
Note
Medium Risk
Changes the canonical unknown agent type value (from "Agent" to "Unknown") and adjusts detection logic, which could affect display/lookup of older stored metadata and attribution in status/commit messages.
Overview
Stops misattributing checkpoints/commit messages to a default agent by standardizing the fallback agent type to
"Unknown".Updates
ReadAgentTypeFromTreeto only return a specific agent based on config directories when exactly one agent config is present (and adds Codex/Cursor detection); otherwise it now returnsUnknown. Adds focused tests for single-agent, multi-agent, andmetadata.json-override scenarios, and updates commit-message/registry tests and comments to clarify thatDefaultAgentName(Claude Code) is setup UX only, not an attribution fallback.Written by Cursor Bugbot for commit 75a41a3. Configure here.