Skip to content

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

Open
tusharmath wants to merge 6 commits intomainfrom
sage-feature-flagged
Open

feat(config): add deep_research feature flag to gate Sage agent#3008
tusharmath wants to merge 6 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
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.

return false;
}
true
}
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.

Move this logic closer to the sub-agent task description. The repo must list all the sub-agents always.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature Brand new functionality, features, pages, workflows, endpoints, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants