Skip to content

fix(logs): report resolved upstream model in egress audit rows - #864

Merged
SsuJojo merged 1 commit into
devfrom
fix/pr-859-egress-audit-model
Oct 13, 2026
Merged

SsuJojo merged 1 commit into
devfrom
fix/pr-859-egress-audit-model

Conversation

@SsuJojo

@SsuJojo SsuJojo commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

Report the model ID actually sent upstream in egress audit and stream-close logs, rather than the client-facing display model with local processing suffixes. Replayed from PR #859 onto the latest dev, preserving its configurable upstream path behavior.

Changes

  • Centralize the resolved model lookup using ProxyRequest.codexRequest.model in src/routes/shared/proxy-handler-utils.ts.
  • Use that ID in direct, proxied, streaming, and non-streaming egress/error log paths while retaining the client-facing model for response translation and metrics.
  • Add regression coverage for -high, -fast, unsuffixed, and legitimate upstream suffix cases; update the changelog.

Test Plan

  • npm test (318 files passed, 5 skipped; 3,367 tests passed, 52 skipped)
  • npm run build (web production build and TypeScript compilation)
  • node_modules/.bin/tsc.cmd --noEmit
  • git diff --check origin/dev...HEAD

Notes

PR #859 remains open and was not merged. In the only cherry-pick conflict, retained dev's configurable upstreamPath and applied the resolved-model logging change.

Linked Issues

Refs #848; replaces #859.

The log window's upstream-model column read ProxyRequest.model, which
chat.ts fills with a *display* name: buildDisplayModelName() re-appends
the -high / -fast suffixes parseModelName() had just stripped. Requests
carrying a local suffix therefore advertised a model that was never
requested upstream - gpt-6-high showed as gpt-6-astra-high while the
wire saw gpt-6-astra.

Route every egress audit row through upstreamModelOf(), which returns
the resolved id the translation layer actually sent. No new suffix
handling is introduced, so a model whose real id ends in an effort word
is still reported verbatim. Ingress rows, the client-facing model echo,
and reasoning-effort / fast-tier / routing behavior are unchanged.

Refs #848
@SsuJojo
SsuJojo merged commit 448b344 into dev Oct 13, 2026
5 checks passed
@SsuJojo
SsuJojo deleted the fix/pr-859-egress-audit-model branch October 13, 2026 09:13
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.

2 participants