feat(channels): SidecarChannelConfig.agent + available_agents (#5671 PR-A)#6105
Merged
Conversation
…PR-A) First, additive, non-breaking slice of the Model A channel-routing redesign (#5671). Renames SidecarChannelConfig.default_agent -> agent with #[serde(alias = "default_agent")] so existing configs keep deserializing, and adds available_agents: Vec<String> (the future /agent whitelist, not yet consulted). No mandatory enforcement, no dispatch/fallback changes, no conversation_bindings table -- those are later PRs. Updated the 5 SidecarChannelConfig field read-sites and a serde roundtrip test.
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
librefang-deploy | 3153ba6 | Jun 14 2026, 07:05 PM |
CHANGELOG bullet and three `///` doc-comment blocks added in the PR-A schema commit used column-wrapped mid-sentence line breaks. Project rule (CLAUDE.md): one sentence per line in CHANGELOG bullets and doc-comments; editors soft-wrap. No logic change.
houko
enabled auto-merge (squash)
June 14, 2026 15:05
DaBlitzStein
added a commit
to DaBlitzStein/librefang
that referenced
this pull request
Jun 16, 2026
…d wake-idle response to channel The wake-idle turn spawned by the async task tracker correctly ran the delegating agent's loop and produced a response, but discarded it because the spawn is not in the channel bridge's call path. - Thread chat_id from the caller's SenderContext through send_to_agent_async_tracked, register_async_task, and PendingTask. - In spawn_wake_idle_turn, after the agent loop completes, forward the response to the home channel via send_channel_message when a chat_id is available. - Fix resolve_agent_home_channel to match the agent field on SidecarChannelConfig (renamed from default_agent in librefang#6105). - Pass sender_context (home channel) to send_message_full in the wake-idle path so the agent loop sees channel context. - When a delegation result exceeds 500 bytes, spill it to the artifact store and include the real handle in the TaskStatus payload so read_artifact can retrieve the full content (stops the agent from hallucinating sha256 hashes). Both format_task_completion_text functions (kernel + runtime) surface the handle.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
First atomic slice (PR-A: config schema) of the Model A channel-routing redesign from RFC #5671. Additive and non-breaking — it lays the schema foundation without changing any dispatch behaviour.
This is PR 1 of ~9. It deliberately does not touch
resolve_or_fallback, the dispatch path, or add theconversation_bindingstable — those land in later PRs.Change
crates/librefang-types/src/config/types.rs,SidecarChannelConfig:default_agent→agentwith#[serde(default, alias = "default_agent")]so existing configs that usedefault_agentkeep deserializing unchanged.available_agents: Vec<String>(#[serde(default)]) — the whitelist that the forthcoming/agentcommand will consult. Reserved/not yet read by any code.[[sidecar_channels]]example block, and the 5SidecarChannelConfigfield read-sites (channel_bridge.rs,channel_sender.rs,messaging.rs,sidecar.rstests).InboxConfig.default_agent,AgentRouter.default_agent, and the OpenClaw importer'sdefault_agentare different structs and are untouched.agentstaysOption<String>for now — mandatory enforcement + boot validation is a later PR.Deferred
A WARN on the deprecated
default_agentkey isn't cleanly doable without customDeserialize(the serde alias gives no signal which key was used); it'll go in the boot-validation PR via the configvalidate()path.Tests
sidecar_agent_field_accepts_legacy_and_new_keys:default_agent = "x"loads intoagent = Some("x")via the alias;agent = "x"loads directly; absent →None;available_agentsdefaults to empty and round-trips.Test plan
cargo test -p librefang-types sidecar_agent_field_accepts_legacy_and_new_keyscargo build -p librefang-kernel -p librefang-channels -p librefang-apicargo clippy -p librefang-types --lib -- -D warningsRefs #5671 (PR-A of the Model A redesign; does not close the issue).