Commit Graph
1581 Commits
Author SHA1 Message Date
Chenyme dbd1a29fda fix: enhance request timeout handling to distinguish between cancellation and deadline expiration 2026-10-16 15:18:24 +08:00
carfeii 6ea58d3a89 fix(voice-ws): observe request timeout and bill confirmed STT duration regardless of transport outcome
Two issues in the voice/STT WebSocket proxy:

1. The established proxy never watched c.Request.Context().Done(), so
   server.requestTimeout had no effect on a quiet, already-admitted
   session: the account lease, concurrency slot, and upstream connection
   stayed open past the configured deadline until a transport error
   occurred on either side. Added a watcher that closes the session once
   the request context is canceled, extracted as watchRequestTimeout so
   it is unit-testable without a real WebSocket upgrade.

2. STT billing was gated on the downstream client closing cleanly
   (successful == ErrorCode == ""), even though the cost is already
   incurred the moment the upstream sends a confirmed transcript.done
   duration. A client that received a complete transcription and then
   disconnected abnormally left EstimatedCostInUSDTicks at zero,
   understating usage against the key's billing limit. Billing is now
   keyed on having a confirmed duration, not on how the transport ended.
2026-10-05 18:21:45 +08:00
Chenyme 7c889a960e docs: update README.md 2026-09-30 12:24:40 +08:00
Chenyme 5e5ad75556 Merge pull request #1054 from chenyme/grok_build_1.0.40
feat: align Grok Build 1.0.40 headers and catalog-driven reasoning menus
2026-09-22 01:28:04 +08:00
Chenyme 9dda42ae41 feat: align Grok Build 1.0.40 headers and catalog-driven reasoning menus 2026-09-22 01:17:29 +08:00
Chenyme 906b9493b0 chore: bump version to v3.1.6 v3.1.6 2026-09-16 10:00:31 +08:00
Chenyme 50c09e26db Merge pull request #1046 from lij768423-svg/fix/short-usage-inflated-dumps
fix: withhold vis<8 and plaintext-ratio dumps; count streamed visible only
2026-09-16 09:58:57 +08:00
Chenyme 62d0e81ee4 Merge branch 'main' into fix/short-usage-inflated-dumps 2026-09-16 09:55:05 +08:00
Chenyme b88ee1f52a docs: update README.md 2026-09-14 09:30:25 +08:00
lij768423-svg 7f3f3d3ce0 fix: withhold vis<8 and plaintext-ratio dumps; count streamed visible only
requestRetry still leaked grok-4.6 dumps after the short-usage patch:
fake-enc/burst required visible >= minOutput, plaintext thinking vetoed
the dump detectors, and chat usage.completion inflated visible tokens.

Withhold when reasoning>=80 or ciphertext meets the floor and the visible
flush is <2s. Plaintext thinking still withholds if flush<2s and
reasoning/output >= 0.8. Cipher-only HasThinking waits until visible text
has streamed for 2s, or the stream ends. Visible tokens come from
streamed content only.

Does not enable requestRetry and does not change lab Docker/VERSION
defaults.
2026-09-12 10:55:54 +08:00
Chenyme 8913b53fe9 Merge pull request #1043 from Solaris-star/fix/console-tool-choice-empty-tools
fix(console): ensure tool_choice is dropped when tools is empty
2026-09-09 15:43:06 +08:00
Chenyme 9af368104a Merge branch 'main' into fix/console-tool-choice-empty-tools 2026-09-09 11:35:09 +08:00
Chenyme 6db9f67fbe fix: drop tool_choice when tools is empty 2026-09-09 11:34:14 +08:00
Chenyme ed9e088300 Merge pull request #1041 from ctermiii/fix/chat-multi-turn-reasoning-bridge
fix(conversation): restore reasoning context in multi-turn chat tool calling
2026-09-09 11:22:40 +08:00
Chenyme e5285ebeb6 fix: filter non-object root union branches safely 2026-09-09 11:08:25 +08:00
Chenyme 7d1b424626 fix: prevent allocation size overflow in reasoning replay 2026-09-09 10:57:06 +08:00
Chenyme dd05325023 Merge branch 'main' into pr/1041 2026-09-09 10:49:06 +08:00
Chenyme ca392e6890 fix: restore reasoning context for multi-turn tool calls 2026-09-09 10:31:00 +08:00
Solaris-star df4dde39ca fix(console): ensure tool_choice is dropped when tools is empty 2026-09-08 08:46:13 +08:00
ctermiii 3de758e793 fix(cli): auto-heal missing reasoning blocks in responses history
- support pipe-delimited call_id lookup (callId|itemId) for pi coding agent
- automatically backfill missing reasoning blocks before function_call in normalizeInputItems
- fallback to recent reasoning proof in conversation history when cache is cold
- prevents tool call deadlocks and infinite repetition in long-running agent loops
2026-09-05 16:37:23 +08:00
ctermiii 5d19ccffbc fix(cli): resolve deep schema refs when flattening multi-branch oneOf roots
- recursively collect properties and required fields across $defs branches in root oneOf/anyOf
- eliminate root-level union rejections from strict upstream validators
- preserve compatibility with single nullable $ref roots
2026-09-05 13:59:44 +08:00
ctermiii 72a3a3475c fix(cli): aggressively flatten root anyOf/oneOf to clean object schema
- completely delete anyOf/oneOf keys from root parameter schema
- merge all properties, required fields, and definitions into root object
- guarantees xAI upstream receives clean type=object schema, eliminating 'root schema is an anyOf/oneOf union with a non-object branch' rejection
2026-09-05 13:44:49 +08:00
ctermiii 22ac653a57 fix(cli): filter non-object branches from tool parameter anyOf/oneOf roots
- normalizeBuildFunctionParametersRoot now discards non-object branches (e.g. string/null) in anyOf/oneOf roots
- hoists single remaining object branch as clean object root with explicit type=object
- fixes xAI 400 rejection: 'tool parameter root must be an object type (root schema is an anyOf/oneOf union with a non-object branch)' on Codex/MCP tools
2026-09-05 12:08:06 +08:00
ctermiii 8641a78233 fix(conversation): restore reasoning context in multi-turn chat tool calling
- add ReasoningCache to map call_id to upstream reasoning proof (encrypted_content)
- capture reasoning block during response.completed (stream) and ConvertResponseJSON (sync)
- restore reasoning block before assistant tool_calls when converting Chat Completions messages
- prevents xAI Build upstream reasoning token drop and infinite loop in multi-turn tool calling
2026-09-05 11:27:26 +08:00
Chenyme 44a390b890 docs: update README.md 2026-09-04 09:41:48 +08:00
Chenyme b46308090b docs: update README.md 2026-09-04 09:34:46 +08:00
Chenyme 995ec8ed8b Merge pull request #1037 from chenyme/reuse
fix: allow manual routes to reuse compatibility aliases
2026-09-02 19:27:10 +08:00
Chenyme 7ebc46c7ac fix: allow manual routes to reuse compatibility aliases 2026-09-02 18:37:32 +08:00
Chenyme 876d394704 Merge pull request #1036 from chenyme/retry
fix: cap account cooldown from upstream Retry-After
2026-09-02 18:10:03 +08:00
Chenyme 15bf810ace fix: cap account cooldown from upstream Retry-After 2026-09-02 18:04:26 +08:00
Chenyme d38c35161a Merge pull request #1034 from chenyme/tool
fix(cli): alias Codex view_image tool for Grok Build
2026-09-02 13:51:14 +08:00
Chenyme 155ebba7d5 fix(cli): alias Codex view_image tool for Grok Build 2026-09-02 13:42:02 +08:00
Chenyme 1c9aedc709 Merge pull request #1030 from buddhism5080/fix/web-free-video-duration-cap
fix: cap Grok Web free-account video duration before upstream
2026-09-01 13:39:51 +08:00
Chenyme 9b80510055 Merge branch 'main' into fix/web-free-video-duration-cap 2026-09-01 11:17:26 +08:00
Chenyme eadfece376 fix: cap free-tier video duration before upstream 2026-09-01 11:16:49 +08:00
Chenyme 6eb490837f Merge pull request #1029 from buddhism5080/fix/xai-function-parameters-root
fix: lift Build function parameter root unions for xAI grammar
2026-09-01 10:29:13 +08:00
Chenyme 08de857a75 Merge branch 'main' into pr/1029
# Conflicts:
#	backend/internal/transport/http/inference/handler_test.go
2026-09-01 10:20:27 +08:00
Chenyme 5f4ebbb781 Merge pull request #1027 from buddhism5080/fix/audit-output-loop-error-code
fix(inference): classify output-loop guard as upstream_output_loop
2026-08-31 23:54:03 +08:00
Chenyme c25705e106 Merge branch 'main' into fix/audit-output-loop-error-code 2026-08-31 23:48:16 +08:00
Chenyme 44807b28ac fix: avoid allocation size overflow in schema normalization 2026-08-31 23:48:02 +08:00
Chenyme d3ba8ff6d5 fix: safely normalize Build function parameter root unions 2026-08-31 23:41:13 +08:00
Chenyme f97be4e553 fix: preserve output-loop code across audits and SSE 2026-08-31 20:49:01 +08:00
Chenyme 1e3b195a64 Merge pull request #1026 from buddhism5080/fix/semantic-idle-pause-when-not-reading
fix(cli): pause semantic idle while not reading upstream
2026-08-31 20:48:44 +08:00
Chenyme c6acb00e0f Merge branch 'main' into pr/1027
# Conflicts:
#	backend/internal/application/gateway/service_test.go
#	backend/internal/transport/http/inference/handler.go
2026-08-31 18:53:19 +08:00
Chenyme b3c4024c73 Merge branch 'main' into fix/semantic-idle-pause-when-not-reading 2026-08-31 18:32:51 +08:00
Chenyme f082e6cb96 fix: guard semantic idle against stale timer callbacks 2026-08-31 18:32:36 +08:00
Chenyme 95722d2992 Merge pull request #1025 from buddhism5080/fix/reasoning-replay-cross-account-no-content-null
fix(cli): share reasoning replay across accounts and omit content:null
2026-08-31 18:19:19 +08:00
Chenyme 543f675522 fix: decouple reasoning replay from credential ID 2026-08-31 17:50:01 +08:00
Chenyme 8b151fd56d Merge pull request #1024 from buddhism5080/fix/audit-overview-cost-scale
fix(audits): scale request-overview cost with USD ticks
2026-08-31 16:38:06 +08:00
Chenyme 1688c8ad75 fix(audits): centralize USD tick formatting 2026-08-31 16:14:19 +08:00