Preserve Exie tool-call context and improve provider telemetry - #2580
Preserve Exie tool-call context and improve provider telemetry#2580ejsmith wants to merge 3 commits into
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5266cdec0a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| foreach (string requestValue in _requestValues) | ||
| { | ||
| value = requestValue.Length >= 8 | ||
| ? value.Replace(requestValue, "[REDACTED]", StringComparison.Ordinal) | ||
| : Regex.Replace(value, $@"(?<!\w){Regex.Escape(requestValue)}(?!\w)", "[REDACTED]", RegexOptions.CultureInvariant, TimeSpan.FromMilliseconds(100)); |
There was a problem hiding this comment.
Redact prompt substrings before logging provider messages
When an upstream error or routing-attempt message echoes only part of a user's prompt, this replaces only the complete message/line stored in _requestValues; non-credential substrings such as names, email addresses, event text, or source fragments therefore remain in ProviderErrorDetails/ProviderRoutingDetails and are logged. This is especially a regression for successful fallback responses, whose routing errors were not previously logged. Either avoid retaining arbitrary message fields or redact request-derived tokens/substrings before emitting these diagnostics.
Useful? React with 👍 / 👎.
5266cde to
5e05f46
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5e05f4665c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| { | ||
| foreach (var detail in reasoningDetails.EnumerateArray()) | ||
| { | ||
| assistantReasoningDetails.Add(detail.Clone()); |
There was a problem hiding this comment.
Merge streamed reasoning-detail fragments by block index
When a provider streams one reasoning_details block across multiple deltas, those fragments carry the same block index and may split text, encrypted data, or a final signature. Appending every fragment as a separate array element produces a different, duplicate-index structure in the follow-up assistant message, so providers that validate signed reasoning can reject the tool continuation or lose its context. Reassemble fragments by index before replaying the block; the added test only covers distinct indexes and therefore misses this common streaming case.
Useful? React with 👍 / 👎.
Superseded by #2567. The model compatibility fixes, provider error details, and response-time telemetry have been consolidated there.
Exie can lose provider reasoning and tool definitions between tool calls and its final answer. Preserve that context, including structured reasoning blocks, and use
tool_choice: "none"to request the final answer. This supports models such as DeepSeek 4.1 while keeping model selection in the existing runtime settings.Log HTTP rejections and streamed provider errors through one structured warning containing the model, provider, HTTP status, error type/code, upstream code, generation ID, organization/conversation IDs, and top-level error message. Read known JSON fields without copying arbitrary provider metadata or flagged input.
Measure total response time, time to first visible text, provider streaming duration, and tool execution through the existing metrics. Correlated response/provider logs include header and first-chunk timings and are enabled in production.
Validation:
get_project_setupand its continuation, with the same compatibility changes.