fix(cli): say what the agent-config target IS when a write is refused - #1629
Merged
Conversation
`error: agent_config agent=OpenCode op=mcp_install path=...` is the whole diagnostic today. The config editors collapse nine distinct fail-closed conditions into a single -1 - unsupported structure, an inline comment on a field line, a non-single-link file, unsafe metadata, lock contention, I/O - and the message separates none of them. Four failures of exactly this shape are sitting in discussion #1560 right now, unresolved across five releases: OpenCode mcp_install on Linux and Windows, Hermes mcp_install and pre_llm_hook_install on both, and a Codex hook_preflight that is new in v0.10.4. One reporter has hit install failures on every release from 0.10.0 to 0.10.4 and is still filing them. Nobody can tell whether these are one bug or four. The refusal now reports what the target actually is: kind and size, observed at the moment of failure. That is enough to split the space - a 19 KB regular file that we refuse to write is a structural refusal, not a permissions or missing-file problem, and that alone rules out most of the candidates. Deliberately NOT errno. This function is called from 119 sites and errno may be stale from an unrelated call. Printing it would repeat #1537 exactly, where a permission decision surfaced a fabricated ENOENT and sent the reporter hunting for a file that was never missing. Only observed facts, or nothing. This is the first step, not the whole fix: the editors should carry their own refusal reason out, the way cbm_daemon_ipc_validation_detail() already does for the daemon. That is 89 failure returns in the YAML editor alone, so it lands separately rather than as an unreviewable diff. cli suite: 270 passed, 0 failed. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
This was referenced Aug 14, 2026
Open
Open
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix(cli): say what the agent-config target IS when a write is refused
error: agent_config agent=OpenCode op=mcp_install path=...is the wholediagnostic today. The config editors collapse nine distinct fail-closed
conditions into a single -1 - unsupported structure, an inline comment on a
field line, a non-single-link file, unsafe metadata, lock contention, I/O - and
the message separates none of them.
Four failures of exactly this shape are sitting in discussion #1560 right now,
unresolved across five releases: OpenCode mcp_install on Linux and Windows,
Hermes mcp_install and pre_llm_hook_install on both, and a Codex hook_preflight
that is new in v0.10.4. One reporter has hit install failures on every release
from 0.10.0 to 0.10.4 and is still filing them. Nobody can tell whether these
are one bug or four.
The refusal now reports what the target actually is: kind and size, observed at
the moment of failure. That is enough to split the space - a 19 KB regular file
that we refuse to write is a structural refusal, not a permissions or
missing-file problem, and that alone rules out most of the candidates.
Deliberately NOT errno. This function is called from 119 sites and errno may be
stale from an unrelated call. Printing it would repeat #1537 exactly, where a
permission decision surfaced a fabricated ENOENT and sent the reporter hunting
for a file that was never missing. Only observed facts, or nothing.
This is the first step, not the whole fix: the editors should carry their own
refusal reason out, the way cbm_daemon_ipc_validation_detail() already does for
the daemon. That is 89 failure returns in the YAML editor alone, so it lands
separately rather than as an unreviewable diff.
cli suite: 270 passed, 0 failed.