Skip to content

arch(llm): llm_dispatch.rs filter_map silently discards unknown ThinkingBlock variants #4534

@bug-ops

Description

@bug-ops

Description

In crates/zeph-core/src/agent/tool_execution/llm_dispatch.rs, unknown ThinkingBlock variants
introduced after #[non_exhaustive] was added to ThinkingBlock are discarded via filter_map
with _ => None.

This is the only forward-compatible option since no MessagePart variant exists to hold an
unknown ThinkingBlock shape. However, if a new ThinkingBlock variant carries data that should
influence tool dispatch (e.g. reasoning steps that affect tool selection), it will be silently
dropped with no log.

Suggested fix

Add a tracing::debug! log in the _ => None arm so that discarded unknown variants are
observable in traces without blocking compilation.

Environment

Metadata

Metadata

Assignees

Labels

P4Long-term / exploratoryarchArchitecture and designllmzeph-llm crate (Ollama, Claude)

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions