Commit Graph

77 Commits

Author SHA1 Message Date
fawney19
ecf6019ccb Merge pull request #543 from zhefox/main
Accept Claude message bodies in OpenAI chat endpoints
2026-05-22 14:53:25 +08:00
zhefox
2a298de971 fix(provider): serialize Claude tool results as JSON strings 2026-05-22 14:41:27 +08:00
fawney19
8ede01ad4e Merge remote-tracking branch 'origin/main' 2026-05-22 14:16:07 +08:00
zhefox
97de4ff8a3 fix(gateway): accept Claude Messages bodies on OpenAI chat endpoints 2026-05-22 14:09:51 +08:00
zhefox
9b95fa4d95 fix(gateway): handle responses-shaped OpenAI chat bodies and SSE passthrough 2026-05-22 11:39:38 +08:00
fawney19
2b32b9a445 Fix system data import export flows 2026-05-22 02:46:49 +08:00
fawney19
0e6d7539ad Merge remote-tracking branch 'origin/pr/538' 2026-05-21 23:12:42 +08:00
fawney19
d6eb41aa78 Merge remote-tracking branch 'origin/pr/536'
# Conflicts:
#	apps/aether-gateway/src/execution_runtime/stream/execution.rs
2026-05-21 23:03:14 +08:00
zhefox
68d8f86dc6 fix(gateway): stop stream polling on downstream disconnect and preserve Codex cache keys 2026-05-21 22:26:14 +08:00
zhefox
12abde2aeb fix(usage): handle terminal stream failures and preserve usage updates 2026-05-21 15:52:51 +08:00
stabey
3330b2ac4c refactor(report-context): extract UPSTREAM_IS_STREAM_KEY constant
The "upstream_is_stream" JSON key flows from the AI execution report
context producer (aether-ai-serving::report_context) through several
consumers — usage runtime metadata copy/move, gateway watchdog, sync
execution decision, observability handlers, and the per-driver usage
repositories. Each site spelled the key as a bare string literal, so a
producer-side rename would silently degrade every consumer to its
fallback (typically assuming streaming) with no compile-time signal.

Introduce a single pub const UPSTREAM_IS_STREAM_KEY in
aether-ai-formats (the lowest crate every consumer already depends on),
re-export from the crate root, and route producer + all map-style
consumers through it. The change is purely a string-literal → constant
swap; behaviour is identical.

Sites left as literals (intentional):
- `json!({"upstream_is_stream": ...})` macro keys, which must be string
  literals at the macro layer; these are also API-response payload
  field names (an external contract that should not silently track
  internal report-context renames).
- SQL column accessors (`try_get::<...>("upstream_is_stream")`), which
  refer to the database schema column, not the JSON key.
- Test fixtures and assertions, which validate the on-the-wire contract
  and should keep verifying the actual string.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 15:26:42 +08:00
zhefox
e59e6c3797 fix(gateway): sanitize Claude thinking and handle missing stream finish 2026-05-21 12:30:42 +08:00
Entropy.Xu
129c7c90c0 fix(provider): 修复 Windsurf 原生工具桥接 2026-05-21 01:02:02 +08:00
Entropy.Xu
82637ad882 fix(provider): 修复 Windsurf Connect 请求与端点计数 2026-05-21 01:02:02 +08:00
Entropy.Xu
0226e14251 feat(provider): 原生接入 Windsurf provider 2026-05-21 01:02:02 +08:00
fawney19
923515ab28 fix: align image generation checks 2026-05-21 00:45:02 +08:00
ZheFox
779877acd0 Merge branch 'fawney19:main' into main 2026-05-20 22:49:49 +08:00
ZheFox
3c6924238f feat(usage): include cache token details in stream usage payloads 2026-05-20 21:20:10 +08:00
MMEXA
fed9bdf01a Fix Codex Responses tool schema and pending recovery 2026-05-20 12:02:00 +00:00
ZheFox
cfa32a2b4d fix(gateway): preserve openai image 200 responses and sync success reporting 2026-05-20 19:17:42 +08:00
ZheFox
2cacf66a37 fix(gateway): route openai image streams with images surface 2026-05-20 18:13:34 +08:00
ZheFox
de7be4f15b fix(gateway): route openai image api requests with mapped models 2026-05-20 17:16:38 +08:00
mayrain
65e3b6f3da fix(codex): trigger image override only on explicit tool_choice
The codex `apply_codex_openai_responses_special_body_edits` override
previously triggered whenever the `tools` array contained an
`image_generation` entry, regardless of whether the caller actually
asked to use it. Codex CLI advertises `image_generation` alongside
~20 other tools under `tool_choice: "auto"`, so every routine codex
conversation was being rewritten into image-generation-only form:

  - `model` forced to `gpt-5.4-mini` (CODEX_OPENAI_IMAGE_INTERNAL_MODEL)
  - `stream` forced to `true`
  - `tools` truncated to a single `image_generation` entry
  - `tool_choice` overwritten to `{"type":"image_generation"}`

The upstream ChatGPT codex backend then rejected the request with
`400 Tool choice 'image_generation' not found in 'tools' parameter`,
which the gateway surfaced as a retryable 503 to clients. The bug
reproduced on every codex CLI session that included the image tool
in its tool catalogue, even though the user never requested image
generation.

Narrow the trigger to the caller's actual selection. The new helper
`codex_openai_responses_tool_choice_references_image_generation`
matches only the explicit string `"image_generation"` or the object
form `{"type":"image_generation"}`. The pre-existing
`is_openai_image_request(provider_api_format)` branch still handles
genuine `openai:image` traffic, so true image-generation flows are
unaffected.

Tests:
  - lock the regression: `tool_choice: "auto"` with image_generation
    in tools must not trigger the override (model/tools preserved)
  - lock variants: string `"image_generation"` and object form both
    still trigger; other tool_choice values and an absent
    `tool_choice` do not
2026-05-20 09:52:39 +08:00
mayrain
b4d17a392a feat(kiro): simulate prompt cache usage accounting 2026-05-19 10:47:17 +08:00
fawney19
052de6b96e test: stabilize merged PR checks 2026-05-19 10:18:25 +08:00
fawney19
69af74b1e0 Merge PR #488 and #489 2026-05-19 03:16:35 +08:00
fawney19
c563c192b7 Merge remote-tracking branch 'origin/pr-483' into merge-pr-483
# Conflicts:
#	apps/aether-gateway/src/ai_serving/planner/standard/openai/chat/decision/payload.rs
#	apps/aether-gateway/src/ai_serving/planner/standard/openai/chat/decision/request.rs
#	apps/aether-gateway/src/ai_serving/planner/standard/openai/responses/decision/payload.rs
#	apps/aether-gateway/src/ai_serving/planner/standard/openai/responses/decision/request.rs
#	apps/aether-gateway/src/execution_runtime/chatgpt_web_image.rs
2026-05-19 02:23:14 +08:00
MMEXA
b480f3aaff fix(gateway): normalize Gemini Vertex embedding transport 2026-05-18 15:39:29 +00:00
MMEXA
b004a02e4a fix(gateway): harden Gemini endpoint routing 2026-05-18 00:53:34 +00:00
ZheFox
c024c782e4 feat(billing): add image quality pricing and usage tracking 2026-05-18 00:11:30 +08:00
ZheFox
680b617b00 feat(gateway): route OpenAI image streams through chat bridge 2026-05-17 23:09:50 +08:00
MMEXA
81ff375bfd fix(gateway): route Gemini embedding batches correctly 2026-05-17 14:24:32 +00:00
ZheFox
0483d001b4 fix(usage): bill cancelled terminal usage and preserve total token estimates 2026-05-17 01:11:42 +08:00
mayrain
5bf236957e feat(grok): add runtime image surfaces 2026-05-16 21:15:38 +08:00
RWDai
6014925e60 style: format codex compact regression tests 2026-05-15 14:40:27 +08:00
RWDai
1dc9b505e4 fix: strip include from codex compact requests 2026-05-15 14:20:16 +08:00
fawney19
01a982bdf6 fix: preserve codex include fields 2026-05-15 03:25:06 +08:00
ZheFox
a0eed2cc51 fix: split Codex chat and responses defaults 2026-05-14 15:33:03 +08:00
fawney19
e251a63cb3 Merge remote-tracking branch 'pr-434/fix-provider-model-test-compat' into aether-rust-pioneer 2026-05-14 01:28:33 +08:00
fawney19
697b6e0653 fix: stabilize openai responses reasoning streams 2026-05-14 00:27:10 +08:00
zhefox
2d354fa294 fix: preserve passthrough for same-format stream rewrites 2026-05-13 19:42:22 +08:00
zhefox
1adbf23be4 feat(ai-formats): add reasoning summary boundaries for streams 2026-05-13 17:41:34 +08:00
zhefox
1726df1169 fix: add codex reasoning defaults and stream rewrite tests 2026-05-13 14:34:16 +08:00
mayrain
8f082674d7 fix: align embedding provider request formats 2026-05-12 20:10:52 +08:00
fawney19
0fa97595bf Fix reasoning model directive response identity 2026-05-11 23:03:11 +08:00
fawney19
ceda0635e4 Merge remote-tracking branch 'origin/pr/424' into aether-rust-pioneer
# Conflicts:
#	crates/aether-provider-transport/src/vertex/auth.rs
#	crates/aether-provider-transport/src/vertex/mod.rs
#	crates/aether-provider-transport/src/vertex/policy.rs
2026-05-11 00:19:04 +08:00
Codex
75df21932a 修复 Gemini 工具结果透传 Vertex 格式 2026-05-10 19:08:35 +08:00
fawney19
228253c166 Merge pull request #410 from Entropy-Xu/codex/codex-image-progress-heartbeat
Add Codex image progress heartbeat
2026-05-10 17:57:33 +08:00
fawney19
0f42a6ed82 Fix Codex image progress heartbeat merge regressions 2026-05-10 02:10:23 +08:00
stabey
dcfdba0a97 fix: preserve claude tool results in openai chat conversion
Preserve all Claude tool_result blocks when emitting OpenAI Chat messages, including multimodal image/file content and is_error markers.
2026-05-09 22:16:27 +08:00