GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(core): keep a Console instance's policy refusal across failed reloads by dezren39 · Pull Request #377 · developing-today-forks/opencode

Conversation

@dezren39

@dezren39 dezren39 commented Oct 24, 2026 •
edited by coderabbitai Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Problem

Fixes #375.

PR #373 refuses a Console instance whose organization sends policies: load() returns refused: true and the provider transform disables that instance's own catalog copy (opencode.work) only while snapshot.refused is set.

That refusal did not survive a failed reload. load()'s error fallback rebuilt the snapshot from the previous one but dropped the flag:

{ config: snapshot.config, connection, organization: snapshot.organization, mcp: snapshot.mcp }

check() re-runs load() every minute, and apply() replaces the snapshot whenever it differs — so one transient Console fetch failure (network error, 5xx, malformed body) for the same connection re-ran the provider transforms with snapshot.refused === undefined, the catalog copy became available again, and the refused organization was served without its policies until the next successful load.

Solution

  • The same-connection failure fallback now preserves refused from the previous snapshot. It is spread in only when set, so unchanged-snapshot detection (Equal.equals in check()) for the main connection is unaffected — an unconditional refused: undefined key made every main-connection snapshot compare as changed.
  • New regression test keeps a refused Console account refused when a later load fails extends the existing refusal scenario: after the initial refusal, the periodic check runs against a Console server returning 502, and opencode.work must stay unavailable with the integration status still needs_auth.

Verification

  • New test fails on unmodified main (after the failed reload, providers.available() returns ["opencode.work"]) and passes with the fix.
  • packages/core: bun test test/plugin/provider-opencode.test.ts — 43/43 pass (including the existing main-connection failure-retention and policy tests); bun test test/plugin/provider-instance.test.ts — 3/3 pass; bun typecheck — clean.
  • Note: GitHub Actions is currently creating no runs repo-wide (CI: GitHub Actions has created no workflow runs repo-wide since 2026-10-23T00:13Z #365), so there are no Actions checks to wait for; verification is local as above.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • Bug Fixes
    • When a configuration reload fails for a previously refused OpenCode Console connection, its refusal status and message are now retained. The connection remains unavailable and marked as requiring authentication, so the refusal is still visible after the failed reload. Other connections continue to use the existing fallback behavior.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@dezren39
fix(core): keep a Console instance's policy refusal across failed rel…
a39799f
…oads

The same-connection failure fallback in OpencodePlugin.load() rebuilt the
snapshot from the previous one but dropped `refused`, so one transient
Console fetch failure re-enabled a refused instance's own catalog copy
(opencode.work) until the next successful load. Preserve the refusal in
the fallback (only when set, so unchanged-snapshot detection for the
main connection is unaffected), and add a regression test that fails a
reload after the initial refusal.

Fixes #375
@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2cbc2fa4-4a49-4f27-a77f-ff6d1b2269b2
Commits

Reviewing files that changed from the base of the PR and between be06d5d and a39799f.

Files selected for processing: 2
  • packages/core/src/plugin/provider/opencode.ts
  • packages/core/test/plugin/provider-opencode.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

When a Console reload fails for the same connection, the fallback now preserves the snapshot’s refusal marker. A regression test checks that the provider remains unavailable and the connection retains its refusal status.

Changes: Console refusal state

Layer / File(s) Summary
Preserve refusal state during failed reload
packages/core/src/plugin/provider/opencode.ts, packages/core/test/plugin/provider-opencode.test.ts
The same-connection fallback carries forward snapshot.refused. The regression test checks that after a 502 reload, the provider remains unavailable and the connection retains needs_auth with the refusal message.

Priority: High

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: High

Possibly related PRs

  • developing-today/opencode#373: It adds the per-instance refusal behavior whose state this change preserves across failed reloads.

Suggested reviewers: vimtor

Merge Risk: Minimal · up to a3979

A failed reload retains the Console account’s refusal, so it does not make the provider available. No actionable merge risk remains in the reviewed change.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: preserving a Console instance's policy refusal across failed reloads.
Description check Passed The description explains the problem, solution, regression test, verification steps, and issue reference. It omits the template's type-of-change and checklist sections, but the core information is com…
Linked Issues check Passed Issue #375 requires stable refusal across a failed same-connection reload, a regression test, and retention of the main connection configuration. The source diff keeps snapshot.refused in the same-c…
Out of Scope Changes check Passed The changes are limited to the fallback in packages/core/src/plugin/provider/opencode.ts and the related regression test in packages/core/test/plugin/provider-opencode.test.ts. Both changes direct…
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Full details: Description check

Explanation

The description explains the problem, solution, regression test, verification steps, and issue reference. It omits the template's type-of-change and checklist sections, but the core information is complete.

Full details: Linked Issues check

Explanation

Issue #375 requires stable refusal across a failed same-connection reload, a regression test, and retention of the main connection configuration. The source diff keeps snapshot.refused in the same-connection fallback only when set. The regression test summary verifies that a later 502 leaves opencode.work unavailable and the integration status at needs_auth. The existing fallback still retains config, organization, and mcp for the main connection. The conditional spread also preserves unchanged-snapshot comparison behavior.

Full details: Out of Scope Changes check

Explanation

The changes are limited to the fallback in packages/core/src/plugin/provider/opencode.ts and the related regression test in packages/core/test/plugin/provider-opencode.test.ts. Both changes directly implement issue #375. No unrelated behavior or files are identified.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2 files.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
  • X
  • Mastodon
  • Reddit
  • LinkedIn

Comment @coderabbitai help to get the list of available commands.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 merged commit a46595d into main Oct 24, 2026
1 check passed

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 deleted the sweep/375-refused-reload branch October 24, 2026 09:19
This was referenced Oct 24, 2026
docs: ROADMAP Done table omits the #375 completion (PR #377) #380
Closed
docs(roadmap): record the #375 completion in Done (#380) #381
Merged
docs: ROADMAP Done table omits the #380 and #124 completions (PRs #381, #384) #387
Closed
docs(roadmap): record the #380 and #124 completions in Done #388
Merged
@dezren39 dezren39 mentioned this pull request Nov 22, 2026
Follow-ups from the 2026-11-22 upstream sync #2677
Open
2 tasks
@dezren39 dezren39 added the audit:complete PR fully implemented spawning issue label Nov 24, 2026
@developing-today-fleet developing-today-fleet Bot mentioned this pull request Nov 24, 2026
fix(core): a failed Console reload drops the policy refusal, re-enabling a refused instance's catalog copy #375
Closed
3 tasks
@dezren39 dezren39 mentioned this pull request Nov 24, 2026
AUDIT-7 Lane 2 — Closed-Issues Review (past month, since 2026-10-23) developing-today/code#13878
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

audit:complete PR fully implemented spawning issue

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

fix(core): a failed Console reload drops the policy refusal, re-enabling a refused instance's catalog copy

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dezren39
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.