fix(install): migrate v0.10.8 OpenCode agent profiles on upgrade (#2264) - #2393
Merged
Merged
Conversation
Upgrading from v0.10.8 to v0.11.0 on a machine with OpenCode reported all
three OpenCode subagent profiles as "preserved modified profile" plus an
op=agent_install error each, and the activation stopped ("one or more agent
configurations failed; the published/current executable was kept"), although
nobody had edited those files.
Root cause: #1933 (v0.11.0) added the tool_search / tool_search_regex
permissions to the rendered OpenCode profile. Install and uninstall recognise
a profile as ours only when it matches the current rendering or one of the
known released renderings (the other access mode, the v0.9.1-rc.1 Codex
shape, the pre-tier Verify file). The v0.10.8 OpenCode shape was not in that
set, so cbm_text_migrate_owned_document classified the untouched v0.10.8
files as user-modified. Reproduced end to end: install with the v0.10.8
release binary, then install with v0.11.0/main, into an isolated HOME; the
three profiles are 1729/1880/1910 bytes, the same sizes as in the report.
cbm_render_graph_profile_opencode_v0108() renders the pre-#1933 shape
(both access modes), and install/uninstall now list it as a released
rendering, so those files are upgraded in place and uninstall removes them
as owned. A profile the user actually edited is still preserved. The
released-list assembly that install and uninstall duplicated moves into one
helper, and the two legacy renderers share one implementation (cli.c drops
three raw free sites; the memory-core baseline is tightened 173 -> 170).
The Codex and OpenCode op=mcp_install errors in the same report do not
reproduce from a pristine v0.10.8 config and depend on the reporter's own
config.toml / opencode.json; they are not addressed here.
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2 tasks done
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.
v0.11.0 (#1933) added the
tool_search/tool_search_regexpermissions to the OpenCode subagent profile. The installer recognises a profile as its own only if it matches the current render or a known released render, and the v0.10.8 OpenCode render was not in that set. Upgrading from v0.10.8 therefore reported all three untouched profiles as "preserved modified profile", recordedop=agent_installerrors, and stopped the activation.cbm_render_graph_profile_opencode_v0108()renders the previous shape in both access modes, and install and uninstall now list it as a released render. Those files are upgraded in place and uninstall removes them as owned. Profiles a user really edited are still preserved.Test:
cli_tiered_opencode_profiles_migrate_v0108_renderfails before the fix, passes after it, and fails again when it is reverted. agent_profiles 13/13 and cli 323/323 pass;make -f Makefile.cbm lint-cipasses.Proof: v0.10.8 release (checksum verified) upgraded to this build in an isolated HOME. Before: rc=1 and three
agent_installerrors, with the reporter's exact byte sizes (1729/1880/1910). After: rc=0 and the profiles are upgraded.The Codex and OpenCode
op=mcp_installerrors in the same report depend on the reporter's own config files and are handled separately (Codex: #2324).Thanks to @zakblacki for the complete transcript.
Fixes #2264