Skip to content

Preserve Exie tool-call context and improve provider telemetry - #2580

Closed
ejsmith wants to merge 3 commits into
mainfrom
issue/exie-openrouter-model-compatibility
Closed

Preserve Exie tool-call context and improve provider telemetry#2580
ejsmith wants to merge 3 commits into
mainfrom
issue/exie-openrouter-model-compatibility

Conversation

@ejsmith

@ejsmith ejsmith commented Sep 10, 2026

Copy link
Copy Markdown
Member

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:

  • Build and 91 focused assistant tests pass, covering tool continuations, reasoning preservation, provider errors, and timing across streamed responses, failures, and cancellation. Controlled-clock tests verify that provider duration excludes browser output time and first-text duration is recorded once.
  • Earlier local browser verification with DeepSeek 4.1 completed two turns, including get_project_setup and its continuation, with the same compatibility changes.
  • Earlier live evaluations produced answers in all four cases; the current-event efficiency check failed because of extra stack lookups, also observed before this fix.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-11T04:41:14.640933Z 4cbe9c4 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +78 to +82
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));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

@ejsmith
ejsmith force-pushed the issue/exie-openrouter-model-compatibility branch from 5266cde to 5e05f46 Compare September 11, 2026 04:28
@ejsmith ejsmith changed the title Fix Exie model tool continuations and provider diagnostics Preserve Exie tool-call context and log provider failures Sep 11, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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());

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

@ejsmith ejsmith changed the title Preserve Exie tool-call context and log provider failures Preserve Exie tool-call context and improve provider telemetry Sep 11, 2026
@github-actions

Copy link
Copy Markdown

Code Coverage

Package Line Rate Branch Rate Complexity Health
Exceptionless.Insulation 37% 35% 286
Exceptionless.Web 85% 70% 8196
Exceptionless.Core 76% 68% 10497
Exceptionless.AppHost 38% 41% 147
Summary 79% (26409 / 33432) 68% (12301 / 18097) 19126

@ejsmith ejsmith closed this Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant