Commit Graph

498 Commits

Author SHA1 Message Date
AAEE86
ce44d35eb6 feat(notification): add Bark push support
Add Bark as a notification-service delivery channel, including encrypted Device Key configuration, server URL/template settings, module status integration, and admin UI support.
2026-05-22 11:08:00 +08:00
fawney19
504c1ccb37 feat: restructure notification services 2026-05-22 01:45:46 +08:00
fawney19
d5e64d6ad9 Merge branch 'pr-503'
# Conflicts:
#	apps/aether-gateway/src/handlers/admin/provider/summary/value.rs
#	apps/aether-gateway/src/lib.rs
#	apps/aether-gateway/src/maintenance/mod.rs
#	apps/aether-gateway/src/maintenance/runtime/workers.rs
#	frontend/src/api/endpoints/types/provider.ts
2026-05-22 00:19:23 +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
fawney19
97997685b5 Merge remote-tracking branch 'origin/pr/498' 2026-05-21 22:56:43 +08:00
fawney19
ab0a90de97 fix(runtime-state): govern redis connections 2026-05-21 22:53:37 +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
77c2d91eb0 fix(gateway): drain downstream-disconnected streams and stop inferring cancelled usage 2026-05-21 20:30:44 +08:00
stabey
cadc45c5b8 fix(data): cleanup uses failed candidate status instead of 504
The stale-pending cleanup task previously hardcoded status_code=504 and a
generic timeout message for every usage row it finalized. When a request
had already been observed as failing — e.g. upstream Connection reset by
peer, watchdog 504, or an authenticated 4xx — the cleanup overwrote that
context with a misleading "服务器超时" outcome and 504 status, hiding the
real cause from the dashboards and customer.

Pull the most recent failed/cancelled candidate per stale request_id and,
if present, finalize the usage row with the candidate's status_code
(defaulting to 502 when none was recorded) and error_message. Requests
that have no terminal candidate (truly stuck pending/streaming) keep the
existing 504 + timeout-message behavior, since they really are timeouts
from the cleanup's perspective. Applied to all three SQL backends with
parameterized UPDATE statements.

The Postgres failed-candidate lookup orders by
COALESCE(finished_at, started_at, created_at) DESC, matching the MySQL
and SQLite ORDER BY clauses so the three backends pick the same
"most recent terminal candidate" under every NULL combination of timing
columns.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-21 16:56:56 +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
be6e49b9c2 Merge branch 'main' of https://github.com/zhefox/Aether 2026-05-21 12:30:48 +08:00
zhefox
e59e6c3797 fix(gateway): sanitize Claude thinking and handle missing stream finish 2026-05-21 12:30:42 +08:00
Entropy.Xu
6b04a0a3a6 fix(windsurf): 修复 native 工具流式回程 2026-05-21 02:55:05 +08:00
Entropy.Xu
4112a8b2ea fix(provider): 修复 Windsurf PR CI 失败 2026-05-21 02:21:35 +08:00
fawney19
b84e4a96e2 chore: tune default postgres settings for 2c4g 2026-05-21 01:36:05 +08:00
fawney19
e7f8b259ac Revert "Merge pull request #517 from zhiqicloud/feat/provider-balance-query"
This reverts commit 7e95e769d5, reversing
changes made to 490306c242.
2026-05-21 01:24:17 +08:00
Entropy.Xu
65c361115a fix(provider): 修复 Windsurf PR 冲突残留 2026-05-21 01:02:02 +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
9466d92a7a fix(provider): 接入 Windsurf 模型拉取和格式转换 2026-05-21 01:02:02 +08:00
Entropy.Xu
208c77a062 fix(provider): 对齐 Windsurf PostAuth 登录链路 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
fawney19
754f672ee2 Merge pull request #526 from MMEXA/fix/codex-responses-pending-recovery-20260520
修复 Codex Responses 工具字段和成功请求回收标记
2026-05-20 21:01:54 +08:00
fawney19
57910f906d Preserve usage provider identity 2026-05-20 20:56:36 +08:00
fawney19
c972bbd397 Fix provider pool exhaustion scheduling 2026-05-20 20:16:57 +08:00
MMEXA
fed9bdf01a Fix Codex Responses tool schema and pending recovery 2026-05-20 12:02:00 +00:00
ZheFox
a31e237cc3 Merge upstream main 2026-05-20 19:28:49 +08: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
fawney19
d0981c2fd5 Merge pull request #522 from RWDai/fix/admin-users-server-pagination
Fix admin users server-side pagination
2026-05-20 18:03:11 +08:00
ZheFox
de7be4f15b fix(gateway): route openai image api requests with mapped models 2026-05-20 17:16:38 +08:00
RWDai
44fb1af287 Fix admin user count clippy lint 2026-05-20 17:06:33 +08:00
RWDai
831554f11d Add admin user export count queries 2026-05-20 16:51:46 +08:00
fawney19
fa5d26ce38 Merge remote-tracking branch 'origin/main' 2026-05-20 16:14:09 +08:00
fawney19
f76bbaab52 feat: support api key ip restriction rules 2026-05-20 16:11:49 +08:00
fawney19
b6bdc08267 Merge branch 'pr-501' 2026-05-20 14:05:00 +08:00
zhiqicloud
122daf0f87 支持 Provider Key 余额查询与自动刷新 2026-05-20 12:33:31 +08:00
RWDai
316b1e3207 Merge remote-tracking branch 'upstream/main' into feat/500-api-key-ip-whitelist 2026-05-20 11:14:43 +08:00
fawney19
4d856f3deb Merge remote-tracking branch 'origin/pr/516' 2026-05-20 10:54:32 +08:00
fawney19
61bcbe826a fix: tighten OAuth auto cleanup signals 2026-05-20 10:34:22 +08:00
RWDai
bdc848b19e Merge upstream main into feat/500-api-key-ip-whitelist 2026-05-20 10:26:56 +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
fawney19
fbda210b84 Merge pull request #511 2026-05-20 01:22:55 +08:00
fawney19
b1a3a26815 Merge pull request #512 from Entropy-Xu/codex/fix-wallet-overdraft-settlement
[codex] 修复钱包余额不足后重复消费
2026-05-20 01:05:26 +08:00
fawney19
94760dbc14 refactor(tunnel): rename aether-proxy to aether-tunnel 2026-05-20 01:02:01 +08:00