Preserve upstream HTTP failures across transport retries, classify title requests before shaping, and rename legacy functions exactly once.
Keep adjacent Responses assistant items together, including interleaved text and calls. Add opt-in prompt environment overrides with matching shell descriptions, strict validation, and WebUI round-trip preservation.
Document compatibility boundaries and retain existing defaults. Include the requested test/ ignore rule. Offline zz_ regressions passed and were removed after validation as requested; vet and Windows/Linux builds passed.
Refs #173, #175, #176, #178, #179, #181
- Remove the new/New prefix from constructors; rename the colliding
types semantically (ModelCatalog, RuntimeController, Metrics,
LogBroker, Redactor, proxyTransports, upstreamNodes, ...).
- Unify upstream lane naming on v1 (/zen, OpenCode 1.x shape) and v2
(/inference and /zen/go, 2.x CLI shape); add models.IsV1Upstream and
drop the duplicated lane detection.
- Fix inaccurate, truncated and stale comments across all packages and
document exported symbols plus non-obvious internals.
- Fix anthropicThinking passing "enabled"/"adaptive" through as an
effort; derive the level from the budget instead.
- Delete dead code (identity.StableID, unused protocol decoders and
stream parser wrappers).
- Export EffectiveListeners, rename modelsDev* metadata constants, and
describe the metadata source as the OpenCode endpoint.
- Rename the forced-collapse log event to stream_collapse_failed and
add an anonymous field.
- Correct the README upstream.zen default and add upstream.anonymous.
Zen's Responses endpoint rejects max_output_tokens below 16, and clients
such as Claude Code send tiny budgets for background tasks. The 400 was
retried across every anonymous exit before reaching the client. Raise
budgets in (0, 16) to 16 on both the bridged and the same-protocol
Responses paths; nil and larger budgets pass through unchanged.
Co-authored-by: ahoo <ahoo@hroze.org>
Native opencode sends prompt_cache_key (session-sliced ID), plus
safety_identifier, store, and service_tier. The translator dropped
all four, so proxied turns never rode prompt-cache affinity while
native did. Decode, carry, and re-emit on both Chat and Responses
paths, omit-when-absent. Verified live: same-session turns hit 99%
cached upstream after warm-up.
Move the command to cmd/opencode2api and group production code into
configuration, gateway, protocol, model, admin, telemetry and helper packages.
Keep shared state private behind context, metrics and runtime interfaces.
Remove the requested test files and replace test-only CI jobs with vet/build
checks. Update Docker and release build paths, preserve version injection and
make the WebUI an explicit embedded asset package.
Add directory trees and source reading guides to both READMEs. Anchor binary
ignore rules so the command package is tracked.