Skip to content

chore: sync upstream fantasy v0.40.0 into coder_2_33 - #51

Merged
ibetitsmike merged 70 commits into
coder_2_33from
mike/sync-upstream-v0.40.0
Aug 10, 2026
Merged

chore: sync upstream fantasy v0.40.0 into coder_2_33#51
ibetitsmike merged 70 commits into
coder_2_33from
mike/sync-upstream-v0.40.0

Conversation

@ibetitsmike

Copy link
Copy Markdown

Syncs coder_2_33 with upstream charmbracelet/fantasy main (042aafc, post v0.40.0; previous sync base was v0.31.0), and reconciles every fork-only patch against what upstream has since landed.

Fork hacks now covered upstream (dropped from our diff)

Fork feature Upstream equivalent
Truncated-stream fail-closed detection (Anthropic + OpenAI Responses, #33) 9aa7447, e277abd (stricter: also require stop_reason; richer IncompleteStreamError), plus stream retry f8664d5, 7ee11fd
Anthropic EffortXHigh f60d4fe (charmbracelet#204)
Anthropic computer use 0cab8bf (charmbracelet#185), incl. computer_20251124 + enable_zoom
Anthropic thinking effort 8a1457c (charmbracelet#147)
Anthropic thinking_display incl. mythos/opus adaptive defaults (#39) e9cf7a1 (charmbracelet#270)
Anthropic replay fidelity: signed reasoning, web_search errors (#35) 53ec8a6 (charmbracelet#238), 26c3c41 (charmbracelet#237)
Anthropic PDF/text documents + sanitized filename titles + unsupported-media warnings (#37, #38) 95dcd6e (charmbracelet#197), a79c920, c9afe3b
Anthropic refusal finish-reason mapping (#41, mapping half) 070e912 (charmbracelet#316) + 7f214ef (also maps Bedrock content_filtered, guardrail_intervened)
gpt-5.5/gpt-5.6 Responses routing (#29, #46) 29b1da1 (charmbracelet#308) + generic gpt-5 fallback from 5bcdd5b (sol/terra/luna aliases kept in the explicit list)
Go 1.25 downgrade + CI toolchain pins Obsolete; module is at go 1.26.5 like upstream
charmbracelet/openai-go module path Upstream migrated back to github.com/openai/openai-go/v3 (6504cf7, charmbracelet#313)

Fork hacks still needed (preserved on top of upstream)

Notable merge resolutions

  • responses_language_model.go: took upstream's single-marshal function_call replay (81aa4e8 fixed the double-marshal our base had) while keeping the fork's reasoning-reference bookkeeping; re-added encoding/json for computer-call raw replay.
  • mapFinishReason: upstream side (superset of ours).
  • CI workflows: left the fork's own build matrix in place; moving back to charmbracelet's reusable workflow is a separate policy decision.

Validation

  • go build ./..., go vet ./..., gofmt clean.
  • go test ./...: all 12 packages pass (507 tests in the two main provider packages, 0 skips), against both upstream openai-go v3.50.0 and the coder/openai-go rebase.

Mux acted on Mike's behalf to create this PR.

taciturnaxolotl and others added 30 commits June 16, 2026 11:43
When the agent's final step was tool-only (no text content),
AgentResult.Response copied that empty step, causing callers to see
no output even though earlier steps produced text. finalResponse now
walks backwards to find the most recent step with non-blank text.
Also clarifies that Text() returns the first text block.
Add ReasoningEffortMax constant and handle it in both the openai and
openaicompat provider hooks. Without this, models that accept "max"
(e.g. GLM-5.2 via Neuralwatt) error with "reasoning model `max` not
supported" before the request reaches the API.

Assisted-by: Crush:glm-5.2
…-effort-max

feat(openai): add max reasoning effort
…ning

ReasoningStart was carrying the first reasoning token in its Delta field, which
broke consumers that treat Start as a pure signal (matching TextStart convention).
Split into empty Start + separate ReasoningDelta. Encrypted single-shot blocks
still use atomic Start+Delta+End since they don't stream.

Assisted-by: Crush:qwen3.7-max
Providers that stream tool call arguments across many fragments (e.g.
GLM 5.2) can produce a valid JSON prefix before the full payload
arrives. The old code finalized on the first valid JSON, truncating
the remaining fragments and producing malformed arguments that caused
API rejections and session crashes on the next turn.

Now deltas flow through incrementally for progress visibility, but
ToolInputEnd and ToolCall are emitted only after the stream completes.
Also fixes a stale delta bug in the new-tool-call branch and adds
deterministic index-sorted finalization for parallel tool calls.

💘 Generated with Crush

Assisted-by: Crush:qwen3.7-max
…acelet#290)

When a model generates an invalid tool name (e.g. Kimi putting call
IDs in the function name field), the error message now lists all
available tools so the model can self-correct on the next turn.

Assisted-by: Crush:claude-opus-4-6
Bumps the all group with 2 updates: [github.com/kaptinlin/jsonschema](https://github.com/kaptinlin/jsonschema) and [google.golang.org/genai](https://github.com/googleapis/go-genai).


Updates `github.com/kaptinlin/jsonschema` from 0.8.0 to 0.9.2
- [Release notes](https://github.com/kaptinlin/jsonschema/releases)
- [Commits](kaptinlin/jsonschema@v0.8.0...v0.9.2)

Updates `google.golang.org/genai` from 1.60.0 to 1.61.0
- [Release notes](https://github.com/googleapis/go-genai/releases)
- [Changelog](https://github.com/googleapis/go-genai/blob/main/CHANGELOG.md)
- [Commits](googleapis/go-genai@v1.60.0...v1.61.0)

---
updated-dependencies:
- dependency-name: github.com/kaptinlin/jsonschema
  dependency-version: 0.9.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
- dependency-name: google.golang.org/genai
  dependency-version: 1.61.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…mbracelet#292)

Bumps the kronk group with 1 update: [github.com/ardanlabs/kronk](https://github.com/ardanlabs/kronk).


Updates `github.com/ardanlabs/kronk` from 1.27.9 to 1.28.0
- [Release notes](https://github.com/ardanlabs/kronk/releases)
- [Commits](ardanlabs/kronk@v1.27.9...v1.28.0)

---
updated-dependencies:
- dependency-name: github.com/ardanlabs/kronk
  dependency-version: 1.28.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: kronk
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
When a model returns more than one tool call in a single turn, the
streamed output stopped marking where one call ended and the next began.
Anything reading the stream as it arrived would merge the calls together,
producing malformed arguments that the provider rejected on the next turn
(seen with GLM 5.2 on Fireworks).

Each tool call is now fully delimited as it streams, so a reader can tell
the calls apart without waiting for the whole response. The final result
of every call is unchanged.
Parse "Input too long" errors from Vercel AI Gateway to extract token
counts and mark as context-too-large errors.

Assisted-by: Crush:qwen3.7-plus
…mbracelet#301)

Bumps the kronk group with 1 update: [github.com/ardanlabs/kronk](https://github.com/ardanlabs/kronk).


Updates `github.com/ardanlabs/kronk` from 1.28.4 to 1.28.5
- [Release notes](https://github.com/ardanlabs/kronk/releases)
- [Commits](ardanlabs/kronk@v1.28.4...v1.28.5)

---
updated-dependencies:
- dependency-name: github.com/ardanlabs/kronk
  dependency-version: 1.28.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: kronk
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the all group with 2 updates: [github.com/aws/smithy-go](https://github.com/aws/smithy-go) and [google.golang.org/genai](https://github.com/googleapis/go-genai).


Updates `github.com/aws/smithy-go` from 1.27.2 to 1.27.3
- [Release notes](https://github.com/aws/smithy-go/releases)
- [Changelog](https://github.com/aws/smithy-go/blob/main/CHANGELOG.md)
- [Commits](aws/smithy-go@v1.27.2...v1.27.3)

Updates `google.golang.org/genai` from 1.61.0 to 1.62.0
- [Release notes](https://github.com/googleapis/go-genai/releases)
- [Changelog](https://github.com/googleapis/go-genai/blob/main/CHANGELOG.md)
- [Commits](googleapis/go-genai@v1.61.0...v1.62.0)

---
updated-dependencies:
- dependency-name: github.com/aws/smithy-go
  dependency-version: 1.27.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: google.golang.org/genai
  dependency-version: 1.62.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…r-message cache markers

Some providers (notably Alibaba Qwen 3.6) only cache prompts when each
cached message block is explicitly tagged, unlike providers that cache
automatically. Previously there was no way to attach those tags, so cache
hits were always zero for those models and every request paid full price.

This adds a general way to attach non-standard fields onto individual
message content blocks, mirroring the existing root-level extra-body
mechanism. When such fields are present the message is sent in the array
form the provider requires; otherwise the simpler plain-text form is kept.
The same mechanism covers any future provider extension without further
changes.

💘 Generated with Crush

Assisted-by: Crush:us.anthropic.claude-opus-4-8
Bumps the all group with 3 updates: [github.com/aws/aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2), [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) and [github.com/kaptinlin/jsonschema](https://github.com/kaptinlin/jsonschema).


Updates `github.com/aws/aws-sdk-go-v2` from 1.42.0 to 1.42.1
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](aws/aws-sdk-go-v2@v1.42.0...v1.42.1)

Updates `github.com/aws/aws-sdk-go-v2/config` from 1.32.25 to 1.32.27
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](aws/aws-sdk-go-v2@config/v1.32.25...config/v1.32.27)

Updates `github.com/kaptinlin/jsonschema` from 0.9.2 to 0.9.3
- [Release notes](https://github.com/kaptinlin/jsonschema/releases)
- [Commits](kaptinlin/jsonschema@v0.9.2...v0.9.3)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2
  dependency-version: 1.42.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: github.com/aws/aws-sdk-go-v2/config
  dependency-version: 1.32.27
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: github.com/kaptinlin/jsonschema
  dependency-version: 0.9.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
andreynering and others added 24 commits July 15, 2026 14:36
…celet#314)

Previous defaults (2 retries, 2s initial delay) were too aggressive for
transient provider errors like rate limits and service unavailable.
New sequence is 5s → 10s → 20s (35s worst case).

Assisted-by: Crush:glm-5.2
Bumps the all group with 3 updates: [github.com/aws/smithy-go](https://github.com/aws/smithy-go), [github.com/openai/openai-go/v3](https://github.com/openai/openai-go) and [google.golang.org/genai](https://github.com/googleapis/go-genai).


Updates `github.com/aws/smithy-go` from 1.27.3 to 1.27.4
- [Release notes](https://github.com/aws/smithy-go/releases)
- [Changelog](https://github.com/aws/smithy-go/blob/main/CHANGELOG.md)
- [Commits](aws/smithy-go@v1.27.3...v1.27.4)

Updates `github.com/openai/openai-go/v3` from 3.43.0 to 3.44.0
- [Release notes](https://github.com/openai/openai-go/releases)
- [Changelog](https://github.com/openai/openai-go/blob/main/CHANGELOG.md)
- [Commits](openai/openai-go@v3.43.0...v3.44.0)

Updates `google.golang.org/genai` from 1.63.0 to 1.64.0
- [Release notes](https://github.com/googleapis/go-genai/releases)
- [Changelog](https://github.com/googleapis/go-genai/blob/main/CHANGELOG.md)
- [Commits](googleapis/go-genai@v1.63.0...v1.64.0)

---
updated-dependencies:
- dependency-name: github.com/aws/smithy-go
  dependency-version: 1.27.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: github.com/openai/openai-go/v3
  dependency-version: 3.44.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
- dependency-name: google.golang.org/genai
  dependency-version: 1.64.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the kronk group with 1 update in the / directory: [github.com/ardanlabs/kronk](https://github.com/ardanlabs/kronk).


Updates `github.com/ardanlabs/kronk` from 1.28.7 to 1.29.0
- [Release notes](https://github.com/ardanlabs/kronk/releases)
- [Commits](ardanlabs/kronk@v1.28.7...v1.29.0)

---
updated-dependencies:
- dependency-name: github.com/ardanlabs/kronk
  dependency-version: 1.29.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: kronk
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the all group with 4 updates: [github.com/aws/aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2), [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2), [github.com/openai/openai-go/v3](https://github.com/openai/openai-go) and [google.golang.org/genai](https://github.com/googleapis/go-genai).


Updates `github.com/aws/aws-sdk-go-v2` from 1.42.1 to 1.43.0
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](aws/aws-sdk-go-v2@v1.42.1...v1.43.0)

Updates `github.com/aws/aws-sdk-go-v2/config` from 1.32.30 to 1.32.31
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](aws/aws-sdk-go-v2@config/v1.32.30...config/v1.32.31)

Updates `github.com/openai/openai-go/v3` from 3.44.0 to 3.46.0
- [Release notes](https://github.com/openai/openai-go/releases)
- [Changelog](https://github.com/openai/openai-go/blob/main/CHANGELOG.md)
- [Commits](openai/openai-go@v3.44.0...v3.46.0)

Updates `google.golang.org/genai` from 1.64.0 to 1.65.0
- [Release notes](https://github.com/googleapis/go-genai/releases)
- [Changelog](https://github.com/googleapis/go-genai/blob/main/CHANGELOG.md)
- [Commits](googleapis/go-genai@v1.64.0...v1.65.0)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2
  dependency-version: 1.43.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
- dependency-name: github.com/aws/aws-sdk-go-v2/config
  dependency-version: 1.32.31
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: github.com/openai/openai-go/v3
  dependency-version: 3.46.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
- dependency-name: google.golang.org/genai
  dependency-version: 1.65.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the kronk group with 1 update in the / directory: [github.com/ardanlabs/kronk](https://github.com/ardanlabs/kronk).


Updates `github.com/ardanlabs/kronk` from 1.29.0 to 1.29.3
- [Release notes](https://github.com/ardanlabs/kronk/releases)
- [Commits](ardanlabs/kronk@v1.29.0...v1.29.3)

---
updated-dependencies:
- dependency-name: github.com/ardanlabs/kronk
  dependency-version: 1.29.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: kronk
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…celet#316)

The Anthropic API can end a response with stop_reason "refusal"
(safety classifier intervention) or "model_context_window_exceeded",
but both fell through to FinishReasonUnknown, leaving clients unable
to distinguish them from a missing stop reason.

Map "refusal" to FinishReasonContentFilter, matching how the OpenAI
and Google providers already surface their native content-filter
stops, and map "model_context_window_exceeded" to
FinishReasonLength alongside "max_tokens".

💘 Generated with Crush

Assisted-by: Kimi K3 (max thinking) via Crush <crush@charm.land>
…let#319)

Co-authored-by: Evelyn Osman (Ashex) <ashex@chipnick.com>
Co-authored-by: Kieran Klukas <kieran@dunkirk.sh>
Bumps the all group with 3 updates: [github.com/kaptinlin/jsonschema](https://github.com/kaptinlin/jsonschema), [github.com/openai/openai-go/v3](https://github.com/openai/openai-go) and [google.golang.org/genai](https://github.com/googleapis/go-genai).


Updates `github.com/kaptinlin/jsonschema` from 0.9.3 to 0.9.6
- [Release notes](https://github.com/kaptinlin/jsonschema/releases)
- [Commits](kaptinlin/jsonschema@v0.9.3...v0.9.6)

Updates `github.com/openai/openai-go/v3` from 3.46.0 to 3.48.0
- [Release notes](https://github.com/openai/openai-go/releases)
- [Changelog](https://github.com/openai/openai-go/blob/main/CHANGELOG.md)
- [Commits](openai/openai-go@v3.46.0...v3.48.0)

Updates `google.golang.org/genai` from 1.65.0 to 1.66.0
- [Release notes](https://github.com/googleapis/go-genai/releases)
- [Changelog](https://github.com/googleapis/go-genai/blob/main/CHANGELOG.md)
- [Commits](googleapis/go-genai@v1.65.0...v1.66.0)

---
updated-dependencies:
- dependency-name: github.com/kaptinlin/jsonschema
  dependency-version: 0.9.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: github.com/openai/openai-go/v3
  dependency-version: 3.48.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
- dependency-name: google.golang.org/genai
  dependency-version: 1.66.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the all group with 6 updates:

| Package | From | To |
| --- | --- | --- |
| [github.com/aws/aws-sdk-go-v2](https://github.com/aws/aws-sdk-go-v2) | `1.43.2` | `1.43.4` |
| [github.com/aws/aws-sdk-go-v2/config](https://github.com/aws/aws-sdk-go-v2) | `1.32.33` | `1.32.35` |
| [github.com/aws/smithy-go](https://github.com/aws/smithy-go) | `1.27.5` | `1.27.6` |
| [github.com/kaptinlin/jsonschema](https://github.com/kaptinlin/jsonschema) | `0.9.6` | `0.9.8` |
| [github.com/openai/openai-go/v3](https://github.com/openai/openai-go) | `3.48.0` | `3.50.0` |
| [google.golang.org/genai](https://github.com/googleapis/go-genai) | `1.66.0` | `1.67.0` |


Updates `github.com/aws/aws-sdk-go-v2` from 1.43.2 to 1.43.4
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](aws/aws-sdk-go-v2@v1.43.2...v1.43.4)

Updates `github.com/aws/aws-sdk-go-v2/config` from 1.32.33 to 1.32.35
- [Release notes](https://github.com/aws/aws-sdk-go-v2/releases)
- [Commits](aws/aws-sdk-go-v2@config/v1.32.33...config/v1.32.35)

Updates `github.com/aws/smithy-go` from 1.27.5 to 1.27.6
- [Release notes](https://github.com/aws/smithy-go/releases)
- [Changelog](https://github.com/aws/smithy-go/blob/main/CHANGELOG.md)
- [Commits](aws/smithy-go@v1.27.5...v1.27.6)

Updates `github.com/kaptinlin/jsonschema` from 0.9.6 to 0.9.8
- [Release notes](https://github.com/kaptinlin/jsonschema/releases)
- [Commits](kaptinlin/jsonschema@v0.9.6...v0.9.8)

Updates `github.com/openai/openai-go/v3` from 3.48.0 to 3.50.0
- [Release notes](https://github.com/openai/openai-go/releases)
- [Changelog](https://github.com/openai/openai-go/blob/main/CHANGELOG.md)
- [Commits](openai/openai-go@v3.48.0...v3.50.0)

Updates `google.golang.org/genai` from 1.66.0 to 1.67.0
- [Release notes](https://github.com/googleapis/go-genai/releases)
- [Changelog](https://github.com/googleapis/go-genai/blob/main/CHANGELOG.md)
- [Commits](googleapis/go-genai@v1.66.0...v1.67.0)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go-v2
  dependency-version: 1.43.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: github.com/aws/aws-sdk-go-v2/config
  dependency-version: 1.32.35
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: github.com/aws/smithy-go
  dependency-version: 1.27.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: github.com/kaptinlin/jsonschema
  dependency-version: 0.9.8
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: all
- dependency-name: github.com/openai/openai-go/v3
  dependency-version: 3.50.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
- dependency-name: google.golang.org/genai
  dependency-version: 1.67.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: all
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…2_33

Merges upstream main (042aafc, post v0.40.0) into coder_2_33.

Fork features dropped because upstream now has equivalents:
- Truncated stream detection for Anthropic and OpenAI Responses
  (upstream 9aa7447, e277abd are stricter, plus stream retry in
  f8664d5, 7ee11fd).
- Anthropic EffortXHigh, computer use, thinking effort, thinking
  display incl. mythos defaults, replay fidelity for signed
  reasoning and web_search errors, PDF and text documents with
  sanitized filename titles.
- gpt-5.5 and gpt-5.6 Responses routing (upstream 29b1da1 plus the
  generic gpt-5 fallback from 5bcdd5b; the sol, terra, and luna
  aliases stay in the explicit list).
- refusal finish-reason mapping (upstream 070e912, 7f214ef also map
  Bedrock content_filtered and guardrail_intervened).

Fork features preserved on top of upstream:
- OpenAI computer use support, migrated to the
  github.com/openai/openai-go/v3 import path.
- OpenAI Responses replay continuity and validation (stored
  reasoning item references, web_search reference pairing,
  function_call output pairing).
- Anthropic reasoning-effort conversion to budget thinking on
  pre-4.6 models and explicit thinking disable for effort none.
- Anthropic refusal stop_details metadata (RefusalMetadata).
- Bedrock cross-region inference profile region mirroring.

Dependency changes:
- Adopt upstream's migration back to github.com/openai/openai-go/v3
  and point its replace at coder/openai-go (coder/pinned rebased
  onto v3.50.0).
- Bump the coder/anthropic-sdk-go replace to the pin coder/coder
  ships (47cab198e449).
- go 1.26.5, kronk v1.29.9 via upstream.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d37f122064

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread providers/openai/responses_options.go
Comment thread providers/openaicompat/provider_options.go
@ibetitsmike
ibetitsmike merged commit bb10946 into coder_2_33 Aug 10, 2026
7 checks passed
ibetitsmike added a commit to coder/coder that referenced this pull request Aug 10, 2026
coder/fantasy#51 merged into coder_2_33 (bb10946892ef) and
coder/openai-go#10 merged into coder/pinned (92b5addb22d2). Both merge
commits carry trees identical to the previously pinned PR heads, so
this is a metadata-only repin onto branch history.
ibetitsmike added a commit to coder/coder that referenced this pull request Aug 11, 2026
…50.0 (#27981)

Our fantasy fork had drifted far behind upstream charmbracelet/fantasy
(base v0.31.0 vs current v0.40.0). This PR updates the pinned forks
after reconciling which fork hacks upstream has fixed and which we still
need, and adapts this repo to the new APIs.

## Fork updates

- `charm.land/fantasy` ->
[coder/fantasy#51](coder/fantasy#51) (merged):
`coder_2_33` synced with upstream v0.40.0, pinned at the merge commit
`bb10946892ef`.
- `github.com/openai/openai-go/v3` ->
[coder/openai-go#10](coder/openai-go#10)
(merged): `coder/pinned` rebased from v3.16.0 onto upstream v3.50.0
(required by upstream fantasy), pinned at the merge commit
`92b5addb22d2`.
- `coder/anthropic-sdk-go` pin unchanged; the fantasy fork now tracks
the same revision this repo ships.

## Hack reconciliation summary

Dropped from our fantasy diff (upstream now has equivalents, often
stricter): truncated-stream fail-closed detection, Anthropic EffortXHigh
/ computer use / thinking effort / thinking display, replay fidelity for
signed reasoning and web_search errors, PDF and text documents with
sanitized filename titles, refusal finish-reason mapping (upstream also
maps Bedrock `content_filtered`/`guardrail_intervened`), gpt-5.5/5.6
Responses routing, the Go 1.25 downgrade, and the openai-go SSE decoder
and appendCompact patches.

Still fork-only and preserved: OpenAI computer use, OpenAI Responses
replay continuity validation, Anthropic pre-4.6 budget-thinking
conversion plus explicit thinking disable for effort none, Anthropic
RefusalMetadata parsing, Bedrock cross-region inference profile region
mirroring, and openai-go deferred body serialization with the
WithJSONSet fix.

Picked up new upstream features: stream transport retry with in-band SSE
error classification, Bedrock expired-credential refresh, per-message
cache markers for OpenAI-compatible models, tool panic recovery, extra
usage fields in provider metadata, and ClientMetadata on tool results.

## Changes in this repo

- `aibridge/intercept/responses`: `ResponseOutputItemUnion.Arguments`
became a union type in openai-go v3.50; read function-call arguments via
`.OfString` (plus test literal updates).
- `coderd/x/chatd/chatdebug`: register the new fantasy `Call.Headers`,
`ObjectCall.Headers`, and `ToolResultPart.ClientMetadata` fields in the
normalization coverage map (all skipped).
- `aibridge/internal/integrationtest`: make the RST test listener drain
the request before resetting the connection. The new SDK's write path
exposed the previous 1-byte-read race as sporadic `use of closed network
connection` failures; the fix holds over 40 consecutive runs.
- `go.mod`: rewrite the fork provenance comments to describe the
post-sync state.

## Validation

- `go build ./...` and `go vet ./...` clean (vet findings identical to
base).
- Fresh (`-count=1`) runs of `./coderd/x/chatd/...`, `./aibridge/...`,
`./coderd/aibridged/...`, `./coderd/database/db2sdk/`: 37 packages pass.
- `TestClientAndConnectionError` stress-tested 40x clean.
- Both fork PRs have green CI.

> Mux acted on Mike's behalf to create this PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.