-
Notifications
You must be signed in to change notification settings - Fork 140
clean up agent, agentautodetect, agentoptions from config #123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR removes agent-specific configuration (agent name, auto-detect flag, and agent options) from the global settings, and shifts agent resolution to be driven by session/checkpoint metadata and installed hooks instead of config files.
Changes:
- Removed
agent,agent_auto_detect, andagent_optionsfromEntireSettings, including their merge logic, accessors (GetAgent,GetAgentOptions), and associated tests. - Updated telemetry and setup flows to derive agent information from installed hooks rather than persisted settings, and to stop persisting a chosen agent in
settings.json. - Tightened agent resolution in rewind, hooks, and debug paths to rely on per-checkpoint agent type and hook context instead of config-based auto-detection, while adding helper utilities for listing installed agents.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/entire/cli/setup_test.go | Removed expectations around agent_options preservation in enable/setup tests now that agent options are no longer part of settings. |
| cmd/entire/cli/setup.go | Stopped writing settings.Agent during non-interactive setup; setup now only persists strategy and strategy options. |
| cmd/entire/cli/root.go | Changed telemetry wiring to compute the agent string from GetAgentsWithHooksInstalled + JoinAgentNames instead of settings.Agent. |
| cmd/entire/cli/rewind.go | Replaced getAgentWithFallback with a stricter getAgent that always uses the checkpoint’s AgentType, and updated all rewind paths (interactive, non-interactive, logs-only, reset) to use it. |
| cmd/entire/cli/hook_registry.go | Modified GetCurrentHookAgent to require a hook context (no more fallback to GetAgent), returning an error when currentHookAgentName is unset. |
| cmd/entire/cli/debug.go | Simplified findTranscriptForSession to require a non-empty AgentType from session state instead of falling back to a detected/default agent. |
| cmd/entire/cli/config_test.go | Removed tests exercising GetAgent, GetAgentOptions, and agent-related settings fields; cleaned up the now-unused agent import. |
| cmd/entire/cli/config.go | Removed agent-related fields and merge logic from EntireSettings, dropped GetAgent/GetAgentOptions, and added GetAgentsWithHooksInstalled and JoinAgentNames helpers used by telemetry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
a6c9c43 to
74c5f00
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
| // GetAgentsWithHooksInstalled returns names of agents that have hooks installed. | ||
| func GetAgentsWithHooksInstalled() []agent.AgentName { | ||
| var installed []agent.AgentName | ||
| for _, name := range agent.List() { | ||
| ag, err := agent.Get(name) | ||
| if err != nil { | ||
| continue | ||
| } | ||
| if hs, ok := ag.(agent.HookSupport); ok && hs.AreHooksInstalled() { | ||
| installed = append(installed, name) | ||
| } | ||
| } | ||
| return installed | ||
| } | ||
|
|
||
| // JoinAgentNames joins agent names into a comma-separated string. | ||
| func JoinAgentNames(names []agent.AgentName) string { | ||
| strs := make([]string, len(names)) | ||
| for i, n := range names { | ||
| strs[i] = string(n) | ||
| } | ||
| return strings.Join(strs, ",") | ||
| } |
Copilot
AI
Jan 29, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GetAgentsWithHooksInstalled and JoinAgentNames are new helpers that are used to drive telemetry but currently have no direct tests in config_test.go, whereas other configuration helpers in this file are covered. Consider adding unit tests that exercise these functions (e.g., with a small set of registered test agents, with and without HookSupport) to ensure the reported agent list and joined string stay correct as agents evolve.
Note
Medium Risk
Medium risk because this removes
GetAgentauto-detection/fallback paths and changes several workflows (rewind,debug, hook execution) to require an explicit agent type from session state, which can introduce new errors for older/missing metadata.Overview
Removes agent-related configuration from
.entire/settings*.json(dropsagent,agent_auto_detect, andagent_options) and deletes the associated resolution helpers/tests (GetAgent,GetAgentOptions).enableno longer persists an agent choice into settings.Updates agent selection to come from runtime context instead of settings:
rewindnow requires anAgentTypeon rewind points (manual-commit points now populateRewindPoint.Agentfrom session state), anddebugtranscript auto-detection now errors if the session lacks an agent type rather than falling back to detection.Telemetry reporting switches from a single configured agent to a comma-separated list of agents with hooks currently installed (
GetAgentsWithHooksInstalled+JoinAgentNames). Hook handling also tightensGetCurrentHookAgentto error when not running in a hook context (no fallback).Written by Cursor Bugbot for commit 320315c. This will update automatically on new commits. Configure here.