Skip to content

fix(config): add deep_research flag to gate Sage agent#3008

Merged
tusharmath merged 10 commits intomainfrom
sage-feature-flagged
Apr 19, 2026
Merged

fix(config): add deep_research flag to gate Sage agent#3008
tusharmath merged 10 commits intomainfrom
sage-feature-flagged

Conversation

@tusharmath
Copy link
Copy Markdown
Collaborator

@tusharmath tusharmath commented Apr 14, 2026

Summary

Add a deep_research feature flag to gate the Sage agent behind a config option, keeping it disabled by default.

Context

The Sage agent provides deep research capabilities but is not yet ready for general availability. This change introduces a configuration flag so the Sage agent (and its :sage app command) can be selectively enabled without requiring a code change or a separate build.

Changes

  • Added deep_research: bool field to ForgeConfig (defaults to false)
  • Updated the default .forge.toml config to include deep_research = false
  • Updated forge.schema.json to document the new field
  • Implemented filter_agent in the agent repository to exclude the Sage agent from get_agents and get_agent_infos when the flag is disabled
  • Applied the filter to both AgentRepository::get_agents and AgentRepository::get_agent_infos

Key Implementation Details

A single filter_agent function checks whether the agent id matches AgentId::SAGE and, if so, gates it on config.deep_research. All other agents pass through unconditionally. The config is read once per call and shared between the filter and the rest of the pipeline to avoid redundant reads.

Use Cases

  • Users on a stable release who do not need deep research get a clean agent list with no Sage agent present
  • Power users or teams that want deep research can opt in by setting deep_research = true in their .forge.toml
  • The flag provides a safe toggle for gradual rollout without shipping a separate binary

Testing

# Run all tests
cargo nextest run

# Verify the filter works by setting deep_research = false (default) and
# checking that the sage agent does not appear in the agent list
# Then set deep_research = true and verify it appears
cargo insta test --accept

Links

  • Related to the Sage agent feature (AgentId::SAGE)

@github-actions github-actions bot added the type: feature Brand new functionality, features, pages, workflows, endpoints, etc. label Apr 14, 2026
@tusharmath tusharmath changed the title feat(config): add deep_research feature flag to gate sage agent feat(config): add deep_research feature flag to gate Sage agent Apr 14, 2026
Comment thread crates/forge_main/src/ui.rs Outdated
self.writeln("Sage agent is disabled. Set `research_subagent = true` in .forge.toml to enable it.")?;
} else {
self.on_agent_change(AgentId::SAGE).await?;
}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

User should be able to switch to sage if they want to. Sage should only be disabled as a sub-agent.

@tusharmath
Copy link
Copy Markdown
Collaborator Author

Related to #3076

@tusharmath tusharmath force-pushed the sage-feature-flagged branch from e46f5bd to efc83dc Compare April 19, 2026 07:58
@tusharmath tusharmath enabled auto-merge (squash) April 19, 2026 08:03
@tusharmath tusharmath changed the title feat(config): add deep_research feature flag to gate Sage agent fix(config): add deep_research feature flag to gate Sage agent Apr 19, 2026
@tusharmath tusharmath added type: fix Iterations on existing features or infrastructure. and removed type: feature Brand new functionality, features, pages, workflows, endpoints, etc. labels Apr 19, 2026
@github-actions github-actions bot added the type: feature Brand new functionality, features, pages, workflows, endpoints, etc. label Apr 19, 2026
@tusharmath tusharmath merged commit 828df37 into main Apr 19, 2026
18 checks passed
@tusharmath tusharmath deleted the sage-feature-flagged branch April 19, 2026 08:06
@tusharmath tusharmath removed the type: feature Brand new functionality, features, pages, workflows, endpoints, etc. label Apr 19, 2026
@github-actions github-actions bot added the type: feature Brand new functionality, features, pages, workflows, endpoints, etc. label Apr 19, 2026
@tusharmath tusharmath removed the type: feature Brand new functionality, features, pages, workflows, endpoints, etc. label Apr 19, 2026
@github-actions github-actions bot added the type: feature Brand new functionality, features, pages, workflows, endpoints, etc. label Apr 19, 2026
@tusharmath tusharmath changed the title fix(config): add deep_research feature flag to gate Sage agent fix(config): add deep_research flag to gate Sage agent Apr 19, 2026
@tusharmath tusharmath removed the type: feature Brand new functionality, features, pages, workflows, endpoints, etc. label Apr 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix Iterations on existing features or infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants