Skip to content

update - #3062

Closed
tanranv5 wants to merge 6 commits into
QuantumNous:mainfrom
tanranv5:main
Closed

update#3062
tanranv5 wants to merge 6 commits into
QuantumNous:mainfrom
tanranv5:main

Conversation

@tanranv5

@tanranv5 tanranv5 commented Feb 28, 2026

Copy link
Copy Markdown

update

Summary by CodeRabbit

Release Notes

  • New Features

    • Added Docker image build and push workflow to GitHub Container Registry (GHCR) with configurable tags and SHA-based versioning.
  • Improvements

    • Enhanced debug logging throughout request relay operations for improved observability.
    • Improved header handling with masked sensitive values in logs.
    • Added request body tracking in context across multiple request handlers.
    • Enhanced model mapping chain resolution with cycle detection.
    • Added guard for gpt-5.2 model family suffix parsing.

@coderabbitai

coderabbitai Bot commented Feb 28, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 21cfc1c and 097ef1f.

📒 Files selected for processing (14)
  • .github/workflows/docker-image-ghcr.yml
  • constant/context_key.go
  • controller/relay.go
  • relay/audio_handler.go
  • relay/channel/api_request.go
  • relay/channel/openai/adaptor.go
  • relay/claude_handler.go
  • relay/compatible_handler.go
  • relay/embedding_handler.go
  • relay/gemini_handler.go
  • relay/helper/model_mapped.go
  • relay/image_handler.go
  • relay/rerank_handler.go
  • relay/responses_handler.go

Walkthrough

This PR adds request body instrumentation and enhanced logging throughout the relay system. It introduces a new context key for storing processed request bodies across handlers, adds extensive debug logging to the relay controller and model mapping, implements header value masking in the API request layer, and adds a gpt-5.2 model family guard condition in suffix parsing logic.

Changes

Cohort / File(s) Summary
CI/CD Workflow
.github/workflows/docker-image-ghcr.yml
New GitHub Actions workflow that builds and pushes Docker images to GHCR, triggered by workflow_dispatch or pushes to main, with automatic repository normalization and dual-tag push (input tag + git SHA).
Constants
constant/context_key.go
Added ContextKeyProcessedRequestBody constant for storing processed request bodies in request context.
Relay Controller
controller/relay.go
Extensive debug logging added around channel selection, request body reading, and retry flow; logs now include model, relay mode, token group, channel details, and error context with remain-times calculation.
Relay Handlers (Context Storage)
relay/audio_handler.go, relay/claude_handler.go, relay/compatible_handler.go, relay/embedding_handler.go, relay/gemini_handler.go, relay/image_handler.go, relay/rerank_handler.go, relay/responses_handler.go
Each handler now stores the processed request body (raw or converted) into the request context under ContextKeyProcessedRequestBody after body transformation, providing context for later error logging and debugging.
API Request & Header Masking
relay/channel/api_request.go
Added header value masking helpers (maskHeaderOverrideValue, maskHeaderOverrideForLog, maskHeaderOverrideForLogString) and updated processHeaderOverride signature to accept gin.Context for enhanced logging of header configurations with sensitive values masked.
Model Parsing
relay/channel/openai/adaptor.go
Added guard in parseReasoningEffortFromModelSuffix to preserve model suffixes for gpt-5.2 family models, bypassing standard suffix-based parsing for this model line.
Model Mapping Helpers
relay/helper/model_mapped.go
Enhanced model mapping with chain tracking via slice accumulation, cycle detection with error handling, debug logging for mapping checks/resolution/results, and fallback defaulting of UpstreamModelName to OriginModelName.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Suggested reviewers

  • seefs001
  • creamlike1024

Poem

🐰 A whisker-twitch of context keys so bright,
Log the bodies dancing through the night,
Mask the headers, hide what shouldn't show,
Chain the models in a clever flow,
GPT-5.2 stands guard so true,
Debug logs bloom in every queue!

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@tanranv5 tanranv5 closed this Feb 28, 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