Commit Graph

10 Commits

Author SHA1 Message Date
Luis Pater
508f8708d0 chore: replace standard JSON package with moego JSON throughout the project 2026-11-16 09:58:12 +08:00
Luis Pater
23e31fe288 fix(executor): stabilize Codex refresh and websocket tests under CPU contention
- Hijack mock CONNECT proxy connections before writing 200 OK and forward buffered client bytes so TLS ClientHello records are not truncated under CPU contention, while isolating Codex refresh test journals.
- Wait for client request payloads and test completion before closing mock websocket connections in Codex keepalive upload tests.
- Cancel the in-flight HTTP upstream context before writing response.incomplete downstream during local websocket interrupts.

Closes: #7379
Co-authored-by: Dylan <1990016@gmail.com>
2026-11-09 22:44:41 +08:00
Luis Pater
68cd75724e fix(codex): prevent replay after uncertain refresh outcomes
- Preserve refresh failure stages and prevent immediate or later grant replay.
- Coordinate durable claims and recovery receipts across file, PostgreSQL, Git, and S3 stores.
- Add regression coverage for retries, concurrency, persistence, and recovery.

Closes: #7289
2026-11-07 01:44:42 +08:00
sususu98
dfe8b182c5 fix(codex,auth): bypass SIWC for OpenAI image requests and route directly to Codex images endpoint 2026-11-05 10:27:44 +08:00
Luis Pater
01b24f1f95 fix(codex): preserve and forward max_output_tokens across request translators
- Update Codex request translators for OpenAI, Claude, Gemini, Interactions, and OpenAI Responses to correctly extract and preserve `max_output_tokens` or equivalent token limit fields.
- Remove automatic deletion of `max_output_tokens` during request cleanup to ensure token limits are respected across execution paths.

Closes: #7230
2026-11-03 20:24:19 +08:00
Luis Pater
6e6afab99a refactor: migrate gjson, sjson, and base64 to MoeForge/moego
- Replace tidwall/gjson and tidwall/sjson with github.com/MoeForge/moego/ojson
  and encoding/base64 with github.com/MoeForge/moego/base64 across the main
  module and examples
- Introduce cross-method *ojson.Doc request rewriting pipelines across
  thinking, signature, client/codex, runtime/executor/helps, pluginhost, and
  all provider executors with FinalizePayloadDoc as the final semantic barrier
- Convert all consecutive JSON mutations (>= 2 Set/SetRaw/Delete operations)
  to batch edits on ojson.Doc
- Upgrade read-only byte paths to ojson.GetBytesNoCopy,
  ojson.GetManyBytesNoCopy, and util.ParseGJSONBytesNoCopy with explicit
  strings.Clone ownership protection across streaming and persistent state
- Use base64.StdEncoding.ValidateString for zero-allocation signature checks
  and base64.EncodeDataURL for single-allocation data URL construction
2026-11-03 03:05:04 +08:00
Luis Pater
a96e640d88 fix(auth): keep sign-in-required Codex credentials quarantined across manual refresh
- Fail forced refreshes when rejected refresh tokens remain unchanged without disk rotation and preserve rejected access token markers across no-op refreshes.
- Require a valid active access token when sign-in is required before restoring active routing status during refresh and lifecycle updates.
- Return the redacted credential entry view from the v8 management credential refresh endpoint.

Closes: #7135
2026-11-01 14:27:47 +08:00
Luis Pater
d946c4fba6 feat(codex): ignore use_siwc and enforce non-SIWC credentials for Codex client requests
- Add request-aware helper functions (`IsCodexClientRequest`, `IsCodexUseSIWCForRequest`, `codexCredsForRequest`, etc.) to detect Codex client user agents and bypass `use_siwc` settings accordingly.
- Update Codex HTTP, streaming, WebSocket, and conductor execution flows to evaluate credentials and routing rules against the incoming request context and headers.
- Add comprehensive regression tests (`TestCodexExecutorCodexClientIgnoresUseSIWC`) covering client identification, credential isolation, default URL resolution, and WebSocket session reuse.

Closes: #6833
2026-10-23 08:09:28 +08:00
Luis Pater
7b0319fb1c feat(codex): support Sign in with ChatGPT 2026-10-12 11:45:25 +08:00
Luis Pater
59baf7314a feat(codex): extract and persist subscription plan type
- Extract `plan_type` from JWT claims and default missing values to `free`
- Include `plan_type` in token data, token storage, auth attributes, and file synthesis
- Ensure `plan_type` is maintained across token refresh flows
- Preserve empty map allocations during auth object cloning
2026-09-28 18:54:03 +08:00