Skip to content

fix(core,mcp): provider display name and MCP injection false positive#2177

Merged
bug-ops merged 1 commit intomainfrom
2173-provider-name-display
Mar 26, 2026
Merged

fix(core,mcp): provider display name and MCP injection false positive#2177
bug-ops merged 1 commit intomainfrom
2173-provider-name-display

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Mar 26, 2026

Summary

Changes

#2173 — provider name display:

  • RuntimeConfig: added active_provider_name: String field
  • builder.rs: with_active_provider_name() builder method
  • provider_cmd.rs: switch/status/list handlers use active_provider_name (fallback to provider.name() when empty)
  • runner.rs: initializes active_provider_name from first pool entry at startup

#2170 — MCP injection false positive:

  • patterns.rs: new_directive regex narrowed from new\s+(instructions?|directives?|roles?|personas?) to new\s+(instructions?|directives?)\s*: — colon suffix required
  • sanitize.rs: regression test new_persona_in_tool_description_not_flagged added

Test plan

  • cargo +nightly fmt --check — clean
  • cargo clippy --features full --workspace --lib --bins -- -D warnings — clean
  • cargo nextest run --workspace --features full --lib --bins — 6469 passed, 0 failed
  • Regression test new_persona_in_tool_description_not_flagged passes
  • Existing /provider tests pass (list/status/switch/already-active paths)

@github-actions github-actions bot added documentation Improvements or additions to documentation rust Rust code changes bug Something isn't working core zeph-core crate size/M Medium PR (51-200 lines) labels Mar 26, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 26, 2026 15:26
…#2173, #2170)

- Store active_provider_name in RuntimeConfig; handle_provider_switch and
  handle_provider_status now display the configured name field from
  [[llm.providers]] instead of the provider type string (fixes #2173)
- Narrow new_directive injection pattern to require colon suffix, preventing
  false positive on "new persona" in Todoist MCP tool descriptions;
  add regression test (fixes #2170)
@bug-ops bug-ops force-pushed the 2173-provider-name-display branch from c88ebdf to 7204e59 Compare March 26, 2026 15:30
@bug-ops bug-ops merged commit 7904f5b into main Mar 26, 2026
25 checks passed
@bug-ops bug-ops deleted the 2173-provider-name-display branch March 26, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working core zeph-core crate documentation Improvements or additions to documentation rust Rust code changes size/M Medium PR (51-200 lines)

Projects

None yet

1 participant