Skip to content

fix(channels): preserve caller-supplied channel name case in channel_send (#6078)#6101

Merged
houko merged 3 commits into
mainfrom
fix/channel-send-preserve-case
Jun 14, 2026
Merged

fix(channels): preserve caller-supplied channel name case in channel_send (#6078)#6101
houko merged 3 commits into
mainfrom
fix/channel-send-preserve-case

Conversation

@houko

@houko houko commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Summary

channel_send force-lowercased the channel argument before the kernel's case-sensitive send_channel_* lookup, while channel adapters register under their config name with original case. Any sidecar whose name carries uppercase (e.g. bot-A) became unreachable — a latent regression since the case-preserving registration in #5996.

Change

Pass the channel name through verbatim (still trimmed) in crates/librefang-runtime/src/tool_runner/channel.rs.

Behaviour note

Channel matching is now case-sensitive (was effectively lowercase-only). Operators who registered an uppercase sidecar and worked around the bug by calling channel_send with a lowercased name must use the exact registered case. Already-matching setups are unaffected.

Test plan

  • cargo build -p librefang-runtime
  • cargo clippy -p librefang-runtime -- -D warnings

Closes #6078

…send (#6078)

channel_send force-lowercased the channel argument before the kernel's case-sensitive send_channel_* lookup, while adapters register under their config name with original case. Any sidecar with uppercase in its name (e.g. bot-A) became unreachable. Pass the name through verbatim (still trimmed).
@github-actions github-actions Bot added the ready-for-review PR is ready for maintainer review label Jun 14, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 14, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
librefang-deploy aad2d4f Jun 14 2026, 03:37 PM

@github-actions github-actions Bot added size/XS < 10 lines changed area/docs Documentation and guides area/runtime Agent loop, LLM drivers, WASM sandbox labels Jun 14, 2026
CLAUDE.md prohibits multi-line comment blocks; the key invariant
(case-sensitive kernel lookup) is preserved in one line.

@houko houko left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Two things to address before merge:

1. Missing regression test

The behavior of tool_channel_send changed (channel names are no longer lowercased), but there is no #[tokio::test] covering this path.
Per project rules (CLAUDE.md "MANDATORY: Integration Testing"), any behavior change in a tool runner should be accompanied by a test that would catch a revert.
A minimal unit test in crates/librefang-runtime/src/tool_runner/channel.rs (or a dedicated tests/ file in that crate) should:

  • call tool_channel_send with channel = "Bot-A" and assert the kernel lookup uses "Bot-A", not "bot-a".

2. Test plan lists cargo build

cargo build -p librefang-runtime is explicitly blocked by project convention (CLAUDE.md: "Do NOT run cargo build or cargo run locally").
The correct local verification is:

cargo check --workspace --lib
cargo clippy --workspace --all-targets -- -D warnings
cargo test -p librefang-runtime

(I've already pushed one mechanical fix to this branch — the 5-line comment block was collapsed to a single line per the "one short line max" comment rule.)


Generated by Claude Code

@houko
houko merged commit 80ba200 into main Jun 14, 2026
31 of 32 checks passed
@houko
houko deleted the fix/channel-send-preserve-case branch June 14, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docs Documentation and guides area/runtime Agent loop, LLM drivers, WASM sandbox ready-for-review PR is ready for maintainer review size/XS < 10 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

channel_send lowercases caller-supplied channel name → lookup fails for capitalized sidecars

2 participants