Skip to content

sync(upstream): 8 commits from upstream - #69

Merged
mergify[bot] merged 12 commits into
mainfrom
sync/upstream-bbd97446c260-8f5ab8e4048a
Sep 16, 2026
Merged

mergify[bot] merged 12 commits into
mainfrom
sync/upstream-bbd97446c260-8f5ab8e4048a

Conversation

@clyang82

@clyang82 clyang82 commented Sep 6, 2026

Copy link
Copy Markdown

Upstream Sync: 8 Commits

Upstream Commits

SHA Intent Type Risk
bbd97446c260 Fix billing integrity issues (Gemini modality normalization, Claude cache-creation sync, negative completion clamping) and complete cross-format relay conversions (Gemini→Claude via Chat pivot, legacy Gemini tool pseudo-names, usage sidecar propagation), while moving per-request stream conversion state onto RelayInfo for clean channel retries. bugfix medium
aece11d2f7f0 Add MiniMax-H3 /v2 video generation support (submit/query/artifact/validation) to the hailuo task plugin, and populate ctx.model/ctx.upstreamModel in query hooks during polling from persisted task properties feature medium
d8ca0ed0bb59 Update AGENTS.md instructions so agent-created PRs for the project owner use the standard human PR templates, while all other agent PRs keep using .agents/github/PR.md internal low
057f71c2336c Fix exposure of privileged billing/admin metadata in logs by replacing the untyped other map with a typed model.LogOther struct that isolates sensitive fields from user-facing serialization, updating all generators, call sites, and the web log-details view. bugfix medium
219c9e06341f Reduce redundant origin requests on anonymous cold start by serving public content endpoints (notice/about/legal/home) with weak-ETag revalidation (304 support) and letting the frontend cache bootstrap/session state with a session hint, plus revalidating stale route sessions. bugfix medium
9f506dd7f905 Consolidate LogOther serialization into a single shared code path, centralize the legacy sensitive-key list, and return original JSON bytes when redaction removes nothing (preserving number lexemes and avoiding re-marshal). refactor medium
9df450fe54e1 Rebuild task-polling plugin hooks around a real persisted TaskQueryContext, classify upstream HTTP statuses in the host before invoking plugins, and fail/refund tasks after a bounded number of consecutive poll failures instead of letting them sit in IN_PROGRESS until the 24h timeout. breaking high
8f5ab8e4048a Fix release workflow to derive the release version from the triggering tag ref instead of relying solely on git describe --tags, with a v*-tag-matched fallback for non-tag builds. internal low

Affected Surfaces

  • Adaptor.ConvertGeminiRequest
  • ChannelMeta.SendResponseCount/InitChannelMeta
  • FormatAdminLogs
  • Frontend session-hint mechanism for anonymous vs authenticated bootstrap
  • JS plugin query hook context (ctx.model / ctx.upstreamModel now populated for polling and realtime fetch, with upstreamModel fallback to origin name)
  • Log 'other' JSON wire shape consumed by web usage-logs details dialog
  • Log.Other wire representation
  • LogOther.JSONString
  • LogOther.MarshalJSON
  • LogOther.SetPublic
  • LogOther.Snapshot
  • NormalizedTaskResult status enum (new "UNKNOWN" value, IN_PROGRESS fallback forbidden)
  • RelayInfo stream conversion state
  • Stale route-session revalidation behavior
  • TASK_POLL_MAX_FAILURES env config key / constant.TaskPollMaxFailures (default 20)
  • TaskPollingAdaptor.FetchTask / BatchTaskPollingAdaptor interface signatures (now take *model.Task and *http.Response)
  • TaskPrivateData.PluginState (new persisted per-plugin state field)
  • TaskPrivateData.PollFailures (new consecutive poll failure counter)
  • TaskQueryContext (plugin API type, query-side requestBody removed)
  • Weak ETag / If-None-Match revalidation on public JSON endpoints (GetNotice, GetAbout, GetUserAgreement, GetPrivacyPolicy, GetHomePageContent)
  • docs/plugin-api v1.d.ts / v1.md / v1.schema.json contract
  • hailuo plugin upstream contract (MiniMax-H3 /v2/video_generation and /v2/query/video_generation/{task_id})
  • hailuo request validation bounds (duration 4-15, resolution 768P/2K, ratio whitelist, frame/reference image-video-audio caps)
  • legacy Gemini pseudo tool name recognition (googleSearch, codeExecution, urlContext)
  • model.LogOther (new exported type replacing map[string]interface{} for log 'other' metadata)
  • model.LogOther.Snapshot()
  • parseTaskResult / parseBatchResult hook signature (new third {status, headers} argument)
  • plugin lint rule warning on || "IN_PROGRESS" literal
  • plugin metadata passthrough fields (metadata.callback_url, metadata.aigc_watermark, metadata.content)
  • service.GenerateTextOtherInfo (return type changed to *model.LogOther)
  • task usage facts (duration, resolution reported as facts; no billing ratios)
  • usage/billing_usage merge semantics (Estimated flag OR-ing, modality key normalization)

Transformations Applied

Downstream File Confidence Notes
relay/channel/claude/adaptor.go high upstream diff applied directly via git apply
relay/channel/claude/adaptor_test.go high upstream diff applied directly via git apply
relay/channel/claude/relay-claude.go high upstream diff applied directly via git apply
relay/channel/gemini/relay-gemini.go high upstream diff applied directly via git apply
relay/channel/openai/helper.go high upstream diff applied directly via git apply
relay/common/relay_info.go high upstream diff applied directly via git apply
relay/common/relay_info_test.go high upstream diff applied directly via git apply
relaykit/dto/billing_usage.go high upstream diff applied directly via git apply
relaykit/dto/billing_usage_test.go high upstream diff applied directly via git apply
relaykit/dto/usage_merge.go high upstream diff applied directly via git apply
relaykit/dto/usage_merge_test.go high upstream diff applied directly via git apply
relaykit/relayconvert/internal/gemini_chat/to_oai_chat_resp.go high upstream diff applied directly via git apply
relaykit/relayconvert/internal/oai_chat/to_claude_messages_resp.go high upstream diff applied directly via git apply
relaykit/relayconvert/internal/oai_chat/to_claude_messages_resp_test.go high upstream diff applied directly via git apply
relaykit/relayconvert/internal/oai_chat/to_gemini_chat_req.go high upstream diff applied directly via git apply
relaykit/relayconvert/internal/toolconv/decode.go high upstream diff applied directly via git apply
relaykit/relayconvert/internal/toolconv/encode.go high upstream diff applied directly via git apply
docs/plugin-api/v1.md high upstream diff applied directly via git apply
plugins/hailuo_responses_test.go high upstream diff applied directly via git apply
plugins/tasks/hailuo/plugin.js high upstream diff applied directly via git apply
relay/channel/task/jsplugin/adaptor.go high upstream diff applied directly via git apply
relay/channel/task/jsplugin/adaptor_test.go high upstream diff applied directly via git apply
relay/relay_task.go high upstream diff applied directly via git apply
service/task_polling.go high upstream diff applied directly via git apply
AGENTS.md high upstream diff applied directly via git apply
.gitignore high upstream diff applied directly via git apply
controller/channel-test.go high upstream diff applied directly via git apply
controller/channel_test_internal_test.go high upstream diff applied directly via git apply
controller/log.go high upstream diff applied directly via git apply
controller/relay.go high upstream diff applied directly via git apply
controller/relay_error_log_test.go high upstream diff applied directly via git apply
model/log.go high upstream diff applied directly via git apply
model/log_format_test.go high upstream diff applied directly via git apply
model/log_other.go high upstream diff applied directly via git apply
model/log_other_test.go high upstream diff applied directly via git apply
relay/convert_request_error_test.go high upstream diff applied directly via git apply
service/billing_usage.go high upstream diff applied directly via git apply
service/channel_affinity.go high upstream diff applied directly via git apply
service/midjourney.go high upstream diff applied directly via git apply
service/quota_saturation_test.go high upstream diff applied directly via git apply
service/task_billing.go high upstream diff applied directly via git apply
service/task_billing_test.go high upstream diff applied directly via git apply
service/task_plugin_audit.go high upstream diff applied directly via git apply
service/text_quota.go high upstream diff applied directly via git apply
service/text_quota_test.go high upstream diff applied directly via git apply
service/violation_fee.go high upstream diff applied directly via git apply
web/src/features/usage-logs/components/__tests__/reject-reason.test.tsx high upstream diff applied directly via git apply
web/src/features/usage-logs/components/dialogs/details-dialog.tsx high upstream diff applied directly via git apply
web/src/features/usage-logs/types.ts high upstream diff applied directly via git apply
controller/misc.go high upstream diff applied directly via git apply
controller/revalidated_response.go high upstream diff applied directly via git apply
docs/authentication.md high upstream diff applied directly via git apply
service/auth_session.go high upstream diff applied directly via git apply
web/src/features/about/api.ts high upstream diff applied directly via git apply
web/src/features/home/api.ts high upstream diff applied directly via git apply
web/src/features/legal/api.ts high upstream diff applied directly via git apply
web/src/lib/api.ts high upstream diff applied directly via git apply
web/src/lib/auth-session.ts high upstream diff applied directly via git apply
web/src/lib/session-hint.ts high upstream diff applied directly via git apply
web/src/routes/(auth)/sign-in.tsx high upstream diff applied directly via git apply
web/src/routes/_authenticated/route.tsx high upstream diff applied directly via git apply
model/log_format_test.go high upstream diff applied directly via git apply
model/log_other.go high upstream diff applied directly via git apply
model/log_other_test.go high upstream diff applied directly via git apply
service/task_billing.go high upstream diff applied directly via git apply
service/task_billing_test.go high upstream diff applied directly via git apply
service/text_quota_test.go high upstream diff applied directly via git apply
.env.example high upstream diff applied directly via git apply
common/init.go high upstream diff applied directly via git apply
constant/env.go high upstream diff applied directly via git apply
controller/plugin_protocol_test.go high upstream diff applied directly via git apply
controller/relay.go high upstream diff applied directly via git apply
controller/task_plugin_test.go high upstream diff applied directly via git apply
docs/plugin-api/v1.d.ts high upstream diff applied directly via git apply
docs/plugin-api/v1.md high upstream diff applied directly via git apply
docs/plugin-api/v1.schema.json high upstream diff applied directly via git apply
model/log_other.go high upstream diff applied directly via git apply
model/task.go high upstream diff applied directly via git apply
model/task_cas_test.go high upstream diff applied directly via git apply
pkg/jsplugin/cli.go high upstream diff applied directly via git apply
pkg/jsplugin/cli_test.go high upstream diff applied directly via git apply
plugins/jimeng_responses_test.go high upstream diff applied directly via git apply
plugins/tasks/alibaba/plugin.js high upstream diff applied directly via git apply
plugins/tasks/doubao/plugin.js high upstream diff applied directly via git apply
plugins/tasks/google/plugin.js high upstream diff applied directly via git apply
plugins/tasks/jimeng/plugin.js high upstream diff applied directly via git apply
plugins/tasks/kling/plugin.js high upstream diff applied directly via git apply
plugins/tasks/sora/plugin.js high upstream diff applied directly via git apply
plugins/tasks/sunoapi/plugin.js high upstream diff applied directly via git apply
plugins/tasks/vertex-ai/plugin.js high upstream diff applied directly via git apply
plugins/veo_poll_test.go high upstream diff applied directly via git apply
relay/channel/adapter.go high upstream diff applied directly via git apply
relay/channel/task/jsplugin/adaptor_test.go high upstream diff applied directly via git apply
relay/common/relay_info.go high upstream diff applied directly via git apply
relay/relay_task.go high upstream diff applied directly via git apply
service/task_billing_test.go high upstream diff applied directly via git apply
service/task_plugin_view_test.go high upstream diff applied directly via git apply
service/task_polling_test.go high upstream diff applied directly via git apply
plugins/tasks/hailuo/plugin.js high The downstream parseTaskResult body is character-identical to the upstream pre-change version; the apply failed only because of version drift in the first hunk's context (downstream meta.version is "1.1.0" where upstream expected "1.1.1"). Applied the upstream intent verbatim: bumped version to 1.1.2 (matching upstream's post-change version), removed the now-stale empty-context comment, replaced both `
plugins/tasks/vidu/plugin.js high The direct apply failed only because surrounding context in the meta block drifted (downstream models list adds viduq3-mix/viduq3-turbo/viduq3/viduq2-pro, while the upstream hunk expected the older 4-model list). The two actual changed lines exist verbatim downstream: the version string and the unknown-state throw in parseTaskResult. Applied the same intent exactly: bump version to 1.0.1 and return the new NormalizedTaskResult { status: "UNKNOWN", reason } instead of throwing on unmapped vendor states, matching the new contract that IN_PROGRESS fallback is forbidden and UNKNOWN is a first-class status. No other parseTaskResult signature change is needed in this file (the new third {status, headers} argument is optional and unused here). (applied 2 targeted edits)
.github/workflows/release.yml high upstream diff applied directly via git apply

⚠️ Conflicts

  • relay/channel/gemini/relay_gemini_usage_test.go (): Resolve call failed: Rate limited after 3 retries: Error code: 429 - {'error': {'code': 'rate_limit_exceeded', 'message': 'Concurrency limit exceeded for user, please retry later', 'type': 'rate_limit_error'}}
  • service/log_info_generate.go (): Resolve call failed: Anthropic API error after 3 retries:
<title>504 Gateway Time-out</title>

504 Gateway Time-out

- **`plugins/hailuo_responses_test.go`** (): Resolve call failed: Rate limited after 3 retries: Error code: 429 - {'error': {'code': 'rate_limit_exceeded', 'message': 'Concurrency limit exceeded for user, please retry later', 'type': 'rate_limit_error'}} - **`relay/channel/task/jsplugin/adaptor.go`** (): Resolve call failed: Rate limited after 3 retries: Error code: 429 - {'error': {'code': 'rate_limit_exceeded', 'message': 'Concurrency limit exceeded for user, please retry later', 'type': 'rate_limit_error'}} - **`service/task_polling.go`** (): Resolve call failed: Rate limited after 3 retries: Error code: 429 - {'error': {'code': 'rate_limit_exceeded', 'message': 'Concurrency limit exceeded for user, please retry later', 'type': 'rate_limit_error'}}

❌ Unresolved Build Failures

  • relay/channel/gemini/relay_gemini_usage_test.go: Resolve call failed: Rate limited after 3 retries: Error code: 429 - {'error': {'code': 'rate_limit_exceeded', 'message': 'Concurrency limit exceeded for user, please retry later', 'type': 'rate_limit_error'}} — Suggestion: Resolve manually — see the conflict summary in this PR.
  • service/log_info_generate.go: Resolve call failed: Anthropic API error after 3 retries:
<title>504 Gateway Time-out</title>

504 Gateway Time-out

— _Suggestion: Resolve manually — see the conflict summary in this PR._ - **`plugins/hailuo_responses_test.go`**: Resolve call failed: Rate limited after 3 retries: Error code: 429 - {'error': {'code': 'rate_limit_exceeded', 'message': 'Concurrency limit exceeded for user, please retry later', 'type': 'rate_limit_error'}} — _Suggestion: Resolve manually — see the conflict summary in this PR._ - **`relay/channel/task/jsplugin/adaptor.go`**: Resolve call failed: Rate limited after 3 retries: Error code: 429 - {'error': {'code': 'rate_limit_exceeded', 'message': 'Concurrency limit exceeded for user, please retry later', 'type': 'rate_limit_error'}} — _Suggestion: Resolve manually — see the conflict summary in this PR._ - **`service/task_polling.go`**: Resolve call failed: Rate limited after 3 retries: Error code: 429 - {'error': {'code': 'rate_limit_exceeded', 'message': 'Concurrency limit exceeded for user, please retry later', 'type': 'rate_limit_error'}} — _Suggestion: Resolve manually — see the conflict summary in this PR._

🤖 Created by upstream-semantic-sync

@coderabbitai

coderabbitai Bot commented Sep 6, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Ignore keyword(s) in the title.

⛔ Ignored keywords (1)
  • sync(upstream)

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 7ef5fcc5-ff0b-4c25-8529-dd5d907ee576

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@clyang82
clyang82 force-pushed the sync/upstream-bbd97446c260-8f5ab8e4048a branch from 6db68a9 to fde829a Compare September 9, 2026 23:57
…y normalization, Claude cache-creation field sync, usage-merge clamping/estimated-flag handling) plus completion of conversion paths: Claude channel now serves Gemini-format requests, legacy pseudo tool names are decoded, upstream Gemini usage rides the billing_usage sidecar, and per-request stream conversion state moves from gin.Context onto RelayInfo so retries reset cleanly.

Upstream-commit: bbd9744
…iluo task plugin with in-builder request validation, and fix query hooks to receive ctx.model/ctx.upstreamModel from persisted task properties during polling

Upstream-commit: aece11d
…or the project owner use the standard human PR templates instead of the agent-specific PR body file.

Upstream-commit: d8ca0ed
…ests also report input media consumption (reference images and input video seconds) in addition to output duration/resolution.

Upstream-commit: 73afad5
…art and public content endpoints by adding weak-ETag/304 revalidation to public JSON responses and client-side session-hint caching

Upstream-commit: 219c9e0
…user-visibility branch and mutating normalizeLegacyAdminFields, centralizing legacy sensitive-key filtering in one shared list, and returning original JSON when nothing was stripped (preserving large-integer lexemes); also logs rejected OtherRatios keys instead of silently dropping them.

Upstream-commit: 9f506dd
…QueryContext, classify upstream HTTP statuses in the host before invoking plugins, and fail/refund tasks after a bounded count of consecutive poll failures instead of letting unrecognized or error responses sit IN_PROGRESS until the 24h timeout.

Upstream-commit: 9df450f
…tent (seeded with the Go module path) into weak ETags, so ETag values stay stable regardless of which JSON serialization package renders the response.

Upstream-commit: 36dbbf0
…riggering git tag (GITHUB_REF) instead of relying solely on `git describe --tags`, with a `v[0-9]*`-matched describe fallback for non-tag runs.

Upstream-commit: 8f5ab8e
@clyang82
clyang82 force-pushed the sync/upstream-bbd97446c260-8f5ab8e4048a branch from e986236 to f6a4c15 Compare September 14, 2026 00:12
…ling contract

The sync landed the ported channel.TaskAdaptor interface and host call sites
(relay/relay_task.go) but left the implementations and legacy polling paths on
the old map[string]any contract, so vet/build failed on the
DoTaskApiRequest interface assertions:

- astraflow/doubao: FetchTask/ParseTaskResult now take the persisted task row
  (task.GetUpstreamTaskID()) instead of the fetch body map; tests updated.
- jsplugin: rebuild query hooks on a persisted TaskQueryContext (no requestBody,
  model identities/data/plugin state from the task row, key override from
  PrivateData.Key), batch queries pass task objects, parse hooks receive the
  HTTP {status,headers} response, and returned plugin state is persisted via
  encodeReturnedPluginState (including submit responses).
- service/task_polling.go: classify upstream HTTP statuses before invoking
  parse hooks (classifyPollHTTP), track PollFailures and fail/refund tasks
  after constant.TaskPollMaxFailures consecutive failures, treat UNKNOWN as a
  terminal escape hatch instead of erroring, and persist PluginState from
  poll results; drop the legacy empty-status/429 error branch.
- controller/video_proxy_gemini.go: call the migrated FetchTask/ParseTaskResult.
- task_billing_test.go: drop the LogOther-era .Snapshot() call so the map-based
  taskBillingOther result is asserted directly.
Bring in main's post-merge-base changes so the PR is mergeable:
- #84: tool_use-id normalization (normalizeToolUseIDsPayload + ToolUseToken on
  stream and non-stream Claude response paths), resolved against the sync's
  Claude/Gemini conversion rework by keeping the new Gemini-format case and
  applying the normalization to the Claude-format case.
- #85: verification codes stored in the shared Redis.

Also picks up their relaykit/convmeta and controller changes. Build, vet, and
the full make test suite pass on the merged tree.
@mergify
mergify Bot merged commit 23e2f54 into main Sep 16, 2026
7 checks passed
@mergify
mergify Bot deleted the sync/upstream-bbd97446c260-8f5ab8e4048a branch September 16, 2026 07:45
@mergify

mergify Bot commented Sep 16, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants