Skip to content

apply_patch failure rate differs sharply by model (aggregate local data) #41494

Description

@ricatix

Description

apply_patch error parts differ materially between two model IDs in same local OpenCode install. This may be model tool-call output quality, but current stored error data does not distinguish invalid patch input from file/context or runtime failures.

Local aggregate, 2026-07-11 through 2026-08-10:

Model ID Attempts Errors Rate
cx/gpt-5.6-terra 1,223 156 12.76%
cx/gpt-5.6-luna 1,092 397 36.36%

An error is stored tool part where type=tool, tool=apply_patch, and state.status=error. Retries count separately. Attribution uses session.model.id, so it is aggregate evidence, not per-invocation proof. No raw paths, code, prompts, diffs, or tool payloads included.

Related: #18108, #20227, #27282.

Plugins

@opencode-ai/plugin 1.15.11

OpenCode version

1.18.15

Steps to reproduce

  1. Use OpenCode with a session whose model.id is either model above.
  2. Perform file edits that invoke apply_patch.
  3. Inspect stored part records for state.status = "error".
  4. Compare error-part count with apply_patch attempt count per model.

I cannot provide a deterministic minimal reproduction yet. What normalized error field or telemetry should be used to separate malformed tool input from file/context and runtime failures?

Screenshot and/or share link

Not available. Sharing local sessions would expose repository data.

Operating System

macOS

Terminal

Not relevant; aggregate data read from local SQLite session store.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions