4 Commits

Author SHA1 Message Date
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
e7b22260dd fix(claude): support plain-text and structured response bodies for missing thread errors
- Extend `IsClaudeThreadNotFound` to identify missing thread errors from plain-text error messages in addition to JSON payloads
- Implement `ResponseBody` on executor `claudeThreadNotFoundError` to supply structured JSON error payloads

Closes: #6443
2026-10-07 23:32:21 +08:00
Luis Pater
a2976eb8a3 fix(claude): share OAuth tool alias store across scoped executor copies
- Pre-allocate `oauthToolAliases` in Claude and Kimi executor constructors so request copies created via `ForAPIKey` reuse the same store
- Replace struct-level mutex with package-level mutex for lazy store allocation to prevent copying mutexes by value

Closes: #6401
2026-10-06 05:45:17 +08:00
Luis Pater
678a92578c feat(claude): preserve OAuth tool aliases across thread continuations
- Add bounded in-memory store to retain Claude OAuth tool alias mappings keyed by message ID
- Restore alias mappings for thread continuation requests omitting tool declarations, returning a request-scoped not found error when state is missing
- Record tool aliases on execution and streaming response completion

Closes: #6346
2026-10-04 23:18:38 +08:00