Commit Graph
7 Commits
Author SHA1 Message Date
Hasan BasbunarandClaude Opus 5.5 ade00a01bb opencode 2: list opencode's hosted provider and its free models again (decision 1595)
From v1.56.0 the generated OpenCode 2 config denied opencode's own provider
("policies", provider.use on "opencode"), and a fresh install copied that deny
into the user's global config: the Agent tab's picker lost the free models
1.x lists beside the box's lanes, a choice nobody had made. The generated
config denies no provider now; the default and small model stay the box's
lane. An update takes the exact deny of v1.56.0 to v1.59.0 out of the global
config (oc-merge-limits.py --remove-provider-deny, after a backup); a policy
of the user's own stays, and disabled_providers is never touched.

Tests: test_oc_provider_deny.py (the tool, and install.sh's own lines on a
v1.59.0 copy), the generated config on both majors, the uninstall purge on
copies with and without the old deny. Red on the old code, green after.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-25 17:55:07 +01:00
Hasan BasbunarandClaude Fable 5.2 cf7c07798a opencode guard: the report's hosts are denied to webfetch too, on both majors
Since v1.40.4 the box's opencode configs deny a shell command naming an Alibaba Cloud host or a
cloud metadata address. On 2026-11-21 the same kind of request left this box as a webfetch tool
call, twice, which no shell rule sees (decision 1561). The same three patterns are now written
for the webfetch tool.

1.x: a block "webfetch*" after "bash*" at the end of "permission" (the plain key "webfetch"
cannot hold an object: 1.19.5 refuses the config), and "*webfetch" after "*bash" in the unit's
OPENCODE_PERMISSION. A block already last and intact is not rewritten, so a box of an earlier
release gets "webfetch*" after its "bash*" and nothing else of its file moves. A block the person
set to one action is theirs: "deny" stands while no key after it speaks for the tool again,
anything else is said (rc 1) and the other block is written still.

2.x: three webfetch rules after the three shell ones, in "permissions" and in the unit's
OPENCODE_CONFIG_CONTENT. A box that served 2.x on v1.56.0 gets the three new rules once; the
rollback to 1.x and the uninstall recognise both shapes of the array, and an empty array is the
person's, not ours.

The unit's values stay this repo's rules alone. On OpenCode 2 the unit's allow overrides every
deny rule of the person's own configs (the content merges after every file): the install's note
said "unless your config has one after it", which no file can have, and now says what happens.

Measured on the real binaries against a scripted endpoint asking for a webfetch whose URL names
aliyuncs.com and points at 127.0.0.1: 1.19.5 and 1.19.6 fetch it with no rule and refuse it with
"webfetch*" and with "*webfetch"; 2.3.2 fetches it under the wildcard allow alone and answers
permission.rejected with the rule after it. Tests red on the old code, green now.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-23 15:45:10 +01:00
Hasan BasbunarandClaude Fable 5.2 5e969f7b21 tests: the uninstall test asks the real opencode its version in its own throwaway HOME
On a box that serves OpenCode 2 (this release's default), the release CI failed on "The offline
suite touches nothing outside itself": OpenCode 2 writes its log file under HOME even for
--version (measured on 2.3.2), and test_the_real_opencode_starts_after_the_purge asked the
version with the suite's own HOME, the witness the step hashes. Its `models` call already ran in
the test's throwaway HOME; the version is asked there too. Found by a witness opencode put first
on the PATH for the 60 test files that name opencode: this one alone called it. With the fix the
witness HOME is byte-identical after the file runs against the real 2.3.2.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-23 04:23:39 +01:00
Hasan BasbunarandClaude Opus 5.5 5a11dfc35b uninstall: the copy a fresh OpenCode 2 install made goes with the key
The code review of v1.56.0 found that a fresh v2 install copies the generated config, with its v2
keys (policies, share, websearch, update), as the user's global config, and the purge of
uninstall.sh --yes did not count those keys as ours: the copy stayed, emptied of its provider,
instead of being moved to a backup like a v1 copy. They count as ours now when they hold exactly
what install.sh writes; a value the user changed keeps the file. Test red on the old code, green
now, and it checks that install.sh and the purge agree on those values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 19:03:59 +01:00
Hasan BasbunarandClaude Opus 5.5 e780dd9f56 tests: the real-opencode uninstall check speaks OpenCode 2 too
test_the_real_opencode_starts_after_the_purge ran `opencode models other` with the box's opencode.
On OpenCode 2, the default since v1.56.0, `models` takes no provider and printed its help, so the
check failed on every box serving 2.x. It now lists every model there, with --standalone: without
it 2.3.2 starts its managed background service, which outlived the test and held its port
(measured 2026-11-22). Red on a 2.3.2 box before, green now, no service left behind.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 19:01:46 +01:00
Hasan BasbunarandClaude Opus 5.5 4f98b3e2fc oc-merge-limits.py: uninstall moves this repo's copy aside again, rules and all
uninstall.sh --yes moved a global opencode config that held only what
install.sh writes to a backup. Since this release the copy also holds the
shell rules under "permission", which the check did not know: the copy
stayed, emptied of its provider, with autoupdate off and the box's
compaction for good (found by a verification before the push). A
"permission" that is exactly deny_permission() is the copy's own, any
other content the user's, which keeps the file.

test_uninstall_opencode.py: the copy with the rules goes aside, a copy
whose rules the user added to stays. The first fails before this commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 00:59:05 +01:00
Hasan BasbunarandClaude Opus 5.5 21ecc040e4 Fixes found by a real uninstall and a real first install on the reference box
- oc and the Agent tab load the box's generated opencode config through
  OPENCODE_CONFIG: on a box emptied and installed with the published
  one-liner, both answered with opencode's hosted free model (big-pickle),
  not the model the box serves.
- uninstall.sh --yes takes the providers that read the API key out of
  opencode's config before deleting the key (opencode refused to start at
  all: "bad file reference"); a file with nothing else of the user's goes to
  a backup (oc-merge-limits.py --remove-providers).
- The uninstall inventory knows the image lane's checkpoint (31 GB), and the
  CI gate on inventory pins reads install-image.sh too.
- The docker room check asks only for the container's room when the image is
  already here (an update with 36 GB free was refused for want of 40).
- A commented-out opencode PATH line no longer counts as one.
- uninstall.sh says when there was nothing to remove.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-23 17:43:37 +02:00