-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat(config): add deep_research feature flag to gate Sage agent #3008
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
Open
tusharmath
wants to merge
6
commits into
main
Choose a base branch
from
sage-feature-flagged
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e1690e4
feat(config): add deep_research feature flag to gate sage agent
tusharmath d7d0f38
refactor(config): rename deep_research field to research_subagent
tusharmath 44a4afd
fix(ui): correct config key name in sage disabled message
tusharmath 2eb5f17
refactor(schema): rename deep_research field to research_subagent
tusharmath 6944b92
Merge branch 'main' into sage-feature-flagged
amitksingh1490 76b8a6b
Merge branch 'main' into sage-feature-flagged
tusharmath File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -162,16 +162,17 @@ impl<F: FileInfoInfra + EnvironmentInfra<Config = ForgeConfig> + DirectoryReader | |
| AgentRepository for ForgeAgentRepository<F> | ||
| { | ||
| async fn get_agents(&self) -> anyhow::Result<Vec<forge_domain::Agent>> { | ||
| let config = self.infra.get_config()?; | ||
| let agent_defs = self.load_agents().await?; | ||
|
|
||
| let session = self | ||
| .infra | ||
| .get_config()? | ||
| let session = config | ||
| .session | ||
| .clone() | ||
| .ok_or(forge_domain::Error::NoDefaultSession)?; | ||
|
|
||
| Ok(agent_defs | ||
| .into_iter() | ||
| .filter(|def| filter_agent(def, &config)) | ||
| .map(|def| { | ||
| def.into_agent( | ||
| ProviderId::from(session.provider_id.clone()), | ||
|
|
@@ -182,9 +183,11 @@ impl<F: FileInfoInfra + EnvironmentInfra<Config = ForgeConfig> + DirectoryReader | |
| } | ||
|
|
||
| async fn get_agent_infos(&self) -> anyhow::Result<Vec<forge_domain::AgentInfo>> { | ||
| let config = self.infra.get_config()?; | ||
| let agent_defs = self.load_agents().await?; | ||
| Ok(agent_defs | ||
| .into_iter() | ||
| .filter(|def| filter_agent(def, &config)) | ||
| .map(|def| forge_domain::AgentInfo { | ||
| id: def.id, | ||
| title: def.title, | ||
|
|
@@ -194,6 +197,15 @@ impl<F: FileInfoInfra + EnvironmentInfra<Config = ForgeConfig> + DirectoryReader | |
| } | ||
| } | ||
|
|
||
| /// Returns `false` for agents that are disabled by a feature flag in the | ||
| /// configuration, `true` for all others. | ||
| fn filter_agent(def: &AgentDefinition, config: &ForgeConfig) -> bool { | ||
| if def.id.as_str() == forge_domain::AgentId::SAGE.as_str() && !config.research_subagent { | ||
| return false; | ||
| } | ||
| true | ||
| } | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
|
|
||
| #[cfg(test)] | ||
| mod tests { | ||
| use pretty_assertions::assert_eq; | ||
|
|
||
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
Oops, something went wrong.
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.
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.
User should be able to switch to sage if they want to. Sage should only be disabled as a sub-agent.