-
Notifications
You must be signed in to change notification settings - Fork 322
fix: apply [agents.channel] config when spawning platform channels #550
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -952,6 +952,24 @@ pub struct ChannelConfig { | |
| pub save_attachments: bool, | ||
| } | ||
|
|
||
| impl ChannelConfig { | ||
| /// Convert to a `ConversationSettings` for use as the agent-level default in | ||
| /// `ResolvedConversationSettings::resolve`. Returns `None` when both fields | ||
| /// match their system defaults (avoids injecting a no-op layer). | ||
| pub fn to_conversation_settings( | ||
| &self, | ||
| ) -> Option<crate::conversation::ConversationSettings> { | ||
| if self.response_mode.is_none() && !self.save_attachments { | ||
| return None; | ||
| } | ||
| Some(crate::conversation::ConversationSettings { | ||
| response_mode: self.response_mode.unwrap_or_default(), | ||
| save_attachments: Some(self.save_attachments), | ||
| ..Default::default() | ||
| }) | ||
| } | ||
|
Comment on lines
+955
to
+970
Contributor
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. Honor This helper ignores the deprecated compatibility field completely. If a config still uses 🤖 Prompt for AI Agents |
||
| } | ||
|
|
||
| /// OpenCode subprocess worker configuration. | ||
| #[derive(Debug, Clone, PartialEq, Eq)] | ||
| pub struct OpenCodeConfig { | ||
|
|
||
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.
to_conversation_settings()currently only treatsresponse_mode = Noneas “default”, soresponse_mode = "active"still injects a no-op layer. Also, whenresponse_modeis set, this will always writesave_attachments: Some(false)even though it's the default.