mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
328e95110c
## Summary - Preserve the optional namespace on custom tool calls during response deserialization and app-server replay. - Use the namespaced tool identifier for streaming argument handling and tool dispatch. - Regenerate app-server protocol schemas. - Add regression tests covering namespace serialization and routing. ## Testing - Ran affected protocol and app-server test suites. - Ran the full core test suite; two load-sensitive timing tests passed when rerun individually. - Ran Clippy and formatting checks. - Verified with a local end-to-end app-server replay that the namespace is preserved through the complete request/response flow.
22 lines
663 B
Rust
22 lines
663 B
Rust
use std::borrow::Cow;
|
|
|
|
use codex_protocol::models::SearchToolCallParams;
|
|
|
|
/// Canonical payload shapes accepted by model-visible tool runtimes.
|
|
#[derive(Clone, Debug, PartialEq)]
|
|
pub enum ToolPayload {
|
|
Function { arguments: String },
|
|
ToolSearch { arguments: SearchToolCallParams },
|
|
Custom { input: String },
|
|
}
|
|
|
|
impl ToolPayload {
|
|
pub fn log_payload(&self) -> Cow<'_, str> {
|
|
match self {
|
|
ToolPayload::Function { arguments } => Cow::Borrowed(arguments),
|
|
ToolPayload::ToolSearch { arguments } => Cow::Owned(arguments.query.clone()),
|
|
ToolPayload::Custom { input } => Cow::Borrowed(input),
|
|
}
|
|
}
|
|
}
|