Skip to content

sync(upstream): 10 commits from upstream - #39

Merged
clyang82 merged 23 commits into
mainfrom
sync/upstream-60a1acb703a6-e99a9bd86fb2
Aug 24, 2026
Merged

clyang82 merged 23 commits into
mainfrom
sync/upstream-60a1acb703a6-e99a9bd86fb2

Conversation

@clyang82

Copy link
Copy Markdown

Upstream Sync: 10 Commits

Upstream Commits

SHA Intent Type Risk
60a1acb703a6 Update import paths in the newapi channel adaptor to use dto and types packages relocated under the relaykit module refactor low
b8bb3f40ac9d Move shared generic types (PriceData, RWMap, Set) out of relaykit/types into the host repo's top-level types package and update all importers, decoupling the relaykit submodule from the host module refactor low
8aa5e754a86b Move trusted-proxy configuration logic from the main package into the middleware package, exporting it as ConfigureTrustedProxies with no behavioral change refactor low
8a7a49072ab0 Add a GitHub Actions workflow that mirrors GitHub releases (on non-alpha tags or manual dispatch) to GitCode, waiting for other release workflows before syncing assets. internal low
2ec6171faa74 Sanitize release note bodies in the GitHub release-sync workflow by replacing ASCII apostrophes with Unicode right single quotes so they cannot break the downstream single-quoted shell script in sync_to_gitcode. internal low
6d57d250f88e Extend the GitCode release-sync workflow by normalizing asset filenames and publishing a bootstrap asset plus an asset matrix as workflow job outputs internal low
f3ab2cff36b3 Enhance the GitCode release-sync workflow to query the GitCode API (using GITCODE_TOKEN/GITCODE_REPOSITORY) and expose has_bootstrap_asset/has_matrix_assets job outputs so bootstrap and matrix asset handling can be driven by what already exists on GitCode rather than purely local file inspection. internal low
a043eef559a9 Add Gemini-to-OpenAI chat streaming response conversion and ensure converted SSE streams emit proper terminal events (finish_reason/[DONE] for OpenAI, message_start/content_block_stop/message_delta/message_stop for Claude) with usage propagation across Gemini→OpenAI, Gemini→Claude, and OpenAI Responses→Claude paths. feature medium
b27b2b1d6f72 Fix iPad login sessions being misidentified as macOS by prioritizing iPad detection in the user-agent parsing of sessionDevice (iPad Safari UAs contain 'Mac OS X'), and relocate the utility tests into a tests directory. bugfix low
e99a9bd86fb2 Introduces per-channel HTTP transport controls (protocol selection and HTTP/2 connection sharding) with validation, a sharded transport implementation in the HTTP client layer, relay adapters passing channel settings through, and corresponding web UI/i18n support. feature medium

Affected Surfaces

  • GITCODE_REPOSITORY
  • GITCODE_TOKEN
  • GeminiChatToOaiChatRespConverter
  • OaiChatToClaudeMessagesRespConverter
  • OaiResponsesToChatStreamHandler
  • ResponseConverterRegistry
  • SSE terminal-event wire format for converted streams
  • TRUSTED_PROXIES
  • TextConverterRegistry
  • channel settings JSON keys (http_protocol, http2_connection_shards)
  • dto.ChannelSettings.HTTP2ConnectionShards
  • dto.ChannelSettings.HTTPProtocol
  • dto.ChannelSettings.ValidateHTTPTransport
  • has_bootstrap_asset
  • has_matrix_assets
  • loginMethodLabel
  • middleware.ConfigureTrustedProxies
  • relay adaptor request paths passing channel settings into HTTP client selection
  • service HTTP client resolution honoring per-channel transport policy (new http_transport_policy.go / http_transport_sharded.go)
  • sessionDevice
  • types.PriceData
  • types.RWMap
  • types.Set

Transformations Applied

Downstream File Confidence Notes
relay/channel/newapi/adaptor.go 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/task.go high upstream diff applied directly via git apply
model/log.go high upstream diff applied directly via git apply
model/pricing.go high upstream diff applied directly via git apply
relay/chat_completions_via_responses_test.go high upstream diff applied directly via git apply
relay/common/relay_info.go high upstream diff applied directly via git apply
relay/helper/price.go high upstream diff applied directly via git apply
relaykit/go.mod high upstream diff applied directly via git apply
relaykit/go.sum high upstream diff applied directly via git apply
relaykit/types/price_data.go high upstream diff applied directly via git apply
relaykit/types/rw_map.go high upstream diff applied directly via git apply
relaykit/types/set.go high upstream diff applied directly via git apply
service/log_info_generate.go high upstream diff applied directly via git apply
service/quota.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
setting/ratio_setting/cache_ratio.go high upstream diff applied directly via git apply
setting/ratio_setting/group_ratio.go high upstream diff applied directly via git apply
setting/ratio_setting/model_ratio.go high upstream diff applied directly via git apply
types/price_data.go high upstream diff applied directly via git apply
types/rw_map.go high upstream diff applied directly via git apply
types/set.go high upstream diff applied directly via git apply
main.go high upstream diff applied directly via git apply
middleware/trusted_proxies.go high upstream diff applied directly via git apply
middleware/trusted_proxies_test.go high upstream diff applied directly via git apply
trusted_proxies.go high upstream diff applied directly via git apply
trusted_proxies_test.go high upstream diff applied directly via git apply
.github/workflows/sync-release-to-gitcode.yml high upstream diff applied directly via git apply
.github/workflows/sync-release-to-gitcode.yml high upstream diff applied directly via git apply
.github/workflows/sync-release-to-gitcode.yml high upstream diff applied directly via git apply
.github/workflows/sync-release-to-gitcode.yml 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/response_registry.go high upstream diff applied directly via git apply
relaykit/relayconvert/terminal_stream_test.go high upstream diff applied directly via git apply
relaykit/relayconvert/testdata/golden/stream/gemini_to_claude.golden.json high upstream diff applied directly via git apply
relaykit/relayconvert/testdata/golden/stream/gemini_to_openai.golden.json high upstream diff applied directly via git apply
relaykit/relayconvert/testdata/golden/stream/openai_responses_to_claude.golden.json high upstream diff applied directly via git apply
relaykit/relayconvert/text_converter_registry.go high upstream diff applied directly via git apply
relaykit/relayconvert/text_converter_registry_test.go high upstream diff applied directly via git apply
relay/channel/openai/chat_via_responses_test.go high The upstream diff has two parts: (1) add the testify/assert import — already present downstream (the fork's ported streaming tests already use assert), so no import edit needed; (2) add the new Claude-terminal-events test after TestOaiResponsesToChatStreamHandlerConvertsSSEOrderAndUsage. The hunk failed downstream only because of context drift (the fork has extra tests with Chinese comments and already-imported assert). Anchored the insertion on the unique TestOaiResponsesToChatBufferedStreamHandlerReturnsJSONFromSSE signature to place the new test in the same position as upstream. All referenced symbols (newResponsesChatTestContext, types.RelayFormatClaude, OaiResponsesToChatStreamHandler, constant.StreamingTimeout, requireOrderedSubstrings, assert) exist in the downstream file verbatim, so the test body is copied unchanged. (applied 1 targeted edits)
web/src/features/profile/components/__tests__/login-session-utils.test.ts high upstream diff applied directly via git apply
web/src/features/profile/components/login-session-item.tsx high upstream diff applied directly via git apply
web/src/features/profile/components/login-session-utils.test.ts high upstream diff applied directly via git apply
web/src/features/profile/components/login-session-utils.ts high upstream diff applied directly via git apply
model/channel.go high upstream diff applied directly via git apply
model/channel_settings_test.go high upstream diff applied directly via git apply
relay/channel/api_request.go high upstream diff applied directly via git apply
relay/channel/aws/relay-aws.go high upstream diff applied directly via git apply
relay/channel/coze/relay-coze.go high upstream diff applied directly via git apply
relay/channel/vertex/service_account.go high upstream diff applied directly via git apply
relaykit/dto/channel_settings.go high upstream diff applied directly via git apply
relaykit/dto/channel_settings_test.go high upstream diff applied directly via git apply
service/http_client.go high upstream diff applied directly via git apply
service/http_client_transport_test.go high upstream diff applied directly via git apply
service/http_transport_policy.go high upstream diff applied directly via git apply
service/http_transport_sharded.go high upstream diff applied directly via git apply
web/src/features/channels/components/drawers/channel-mutate-drawer.tsx high upstream diff applied directly via git apply
web/src/features/channels/constants.ts high upstream diff applied directly via git apply
web/src/features/channels/lib/channel-form-errors.ts high upstream diff applied directly via git apply
web/src/features/channels/lib/channel-form.ts high upstream diff applied directly via git apply
web/src/features/channels/types.ts high upstream diff applied directly via git apply
web/src/i18n/locales/en.json high upstream diff applied directly via git apply
web/src/i18n/locales/zh-TW.json high upstream diff applied directly via git apply
web/src/i18n/locales/zh.json high upstream diff applied directly via git apply

⚠️ Conflicts

  • web/src/i18n/locales/fr.json (): resolve returned neither edits nor content
  • web/src/i18n/locales/ja.json (): resolve returned neither edits nor content
  • web/src/i18n/locales/ru.json (): resolve returned neither edits nor content
  • web/src/i18n/locales/vi.json (): resolve returned neither edits nor content

❌ Unresolved Build Failures

  • web/src/i18n/locales/fr.json: resolve returned neither edits nor content — Suggestion: Resolve manually — see the conflict summary in this PR.
  • web/src/i18n/locales/ja.json: resolve returned neither edits nor content — Suggestion: Resolve manually — see the conflict summary in this PR.
  • web/src/i18n/locales/ru.json: resolve returned neither edits nor content — Suggestion: Resolve manually — see the conflict summary in this PR.
  • web/src/i18n/locales/vi.json: resolve returned neither edits nor content — Suggestion: Resolve manually — see the conflict summary in this PR.

🤖 Created by upstream-semantic-sync

…tor's line-number layer that was overlaying and hiding highlighted editor content, accepting the prior horizontal-scroll gutter overlap as a known cosmetic tradeoff

Upstream-commit: ae17f27
…-image' and 'gemini-3.1-flash-image' in the channel model list and mark them as image-generation models in default Gemini settings

Upstream-commit: 8b41def
… so single-segment TokenHub API keys are routed through the OpenAI-compatible adaptor (with the TokenHub base URL) while legacy three-segment ak/sk keys continue using the native TC3 adaptor.

Upstream-commit: 08f88d2
…d can be fully cleared (empty string no longer reset to "0" by the prop-sync effect), and enforce the global minimum topup per payment method via Math.max with getMinTopupAmount.

Upstream-commit: ab65d25
…to avoid triggering filtering/fetching on every keystroke (performance improvement)

Upstream-commit: 3e1e728
…rovider surcharge settlement in billing, a new Sub2API upstream channel type, a /v1/alpha/search relay endpoint, and surcharge breakdown display in the usage-log UI.

Upstream-commit: 2d23cdf
…ion sweep and its CAS tests, advances the refund legacy cutoff to 2026-02-22, and gates the async-task poller on unfinished sync tasks instead of the old polling-work check.

Upstream-commit: bc14c18
…wn relay adaptor, API/channel type constants, an OpenAI ResponseCompact endpoint type, and corresponding web UI configuration, refactoring shared logic out of the Sub2API adaptor.

Upstream-commit: 398cdaf
…ompact by adding APITypeAdvancedCustom to the IsResponsesCompactAPIType allowlist

Upstream-commit: f51dd4d
…layconvert, reasonmap) into a standalone, dependency-free 'relaykit' Go submodule, decoupling converters from gin/RelayInfo/settings via new convmeta.Meta/convmeta.Options and kitutil abstractions, with byte-level conversion behavior pinned by golden snapshot tests

Upstream-commit: 86ac0f7
…use dto and types packages relocated under the relaykit module

Upstream-commit: 60a1acb
… of relaykit/types into the host repo's top-level types package and update all importers, decoupling the relaykit submodule from the host module

Upstream-commit: b8bb3f4
…package into the middleware package, exporting it as ConfigureTrustedProxies with no behavioral change

Upstream-commit: 8aa5e75
…eases (on non-alpha tags or manual dispatch) to GitCode, waiting for other release workflows before syncing assets.

Upstream-commit: 8a7a490
…nc workflow by replacing ASCII apostrophes with Unicode right single quotes so they cannot break the downstream single-quoted shell script in sync_to_gitcode.

Upstream-commit: 2ec6171
…ng asset filenames and publishing a bootstrap asset plus an asset matrix as workflow job outputs

Upstream-commit: 6d57d25
…e GitCode API (using GITCODE_TOKEN/GITCODE_REPOSITORY) and expose has_bootstrap_asset/has_matrix_assets job outputs so bootstrap and matrix asset handling can be driven by what already exists on GitCode rather than purely local file inspection.

Upstream-commit: f3ab2cf
…on and ensure converted SSE streams emit proper terminal events (finish_reason/[DONE] for OpenAI, message_start/content_block_stop/message_delta/message_stop for Claude) with usage propagation across Gemini→OpenAI, Gemini→Claude, and OpenAI Responses→Claude paths.

Upstream-commit: a043eef
…by prioritizing iPad detection in the user-agent parsing of sessionDevice (iPad Safari UAs contain 'Mac OS X'), and relocate the utility tests into a __tests__ directory.

Upstream-commit: b27b2b1
…col selection and HTTP/2 connection sharding) with validation, a sharded transport implementation in the HTTP client layer, relay adapters passing channel settings through, and corresponding web UI/i18n support.

Upstream-commit: e99a9bd
@coderabbitai

coderabbitai Bot commented Aug 24, 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: Pro Plus

Run ID: 3ad5ddb6-93bf-457d-aefc-97d18c9a8659

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.

@mergify

mergify Bot commented Aug 24, 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

Base automatically changed from sync/upstream-ae17f2749d16-86ac0f7745cc to main August 24, 2026 07:04
Resolve PR 39 conflicts:
- Keep fork channel renumbering (AstraFlow=59, Sub2API=60, NewAPI=61) in
  web channel config, icon map, and tests
- Preserve fork fixes from main: relaykit/types ErrorCodeStream constants,
  relaykit/dto imports in controller/playground.go and plugin_loop, task
  adaptor taskdto aliasing
- Complete PR 39's PriceData/RWMap/Set move: root types/ holds them, all
  host importers (ratio_setting, model/log.go, service/task_billing.go,
  controller/task.go) point at root types
- Keep relaykit go.mod dependency-free (drop stale shopspring/decimal),
  bump indirect x/text to v0.37.0 to match root module
@clyang82

Copy link
Copy Markdown
Author

Conflict resolution on this branch (commit a75e8cc17) was AI-assisted (Claude Code). The resolution preserves the fork's channel renumbering (AstraFlow=59, Sub2API=60, NewAPI=61) and relaykit import fixes from main, while completing PR 39's PriceData/RWMap/Set move to the host types/ package. Build, vet, Go tests (root + relaykit), and frontend tests/typecheck all pass.

@clyang82
clyang82 merged commit 6a19e3f into main Aug 24, 2026
6 checks passed
@clyang82
clyang82 deleted the sync/upstream-60a1acb703a6-e99a9bd86fb2 branch August 24, 2026 07:42
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