Skip to content

fix(opencode): reload workspace configuration resources - #52037

Open
lazyayuan wants to merge 1 commit into
anomalyco:devfrom
lazyayuan:workspace-hot-reload
Open

lazyayuan wants to merge 1 commit into
anomalyco:devfrom
lazyayuan:workspace-hot-reload

Conversation

@lazyayuan

@lazyayuan lazyayuan commented Sep 29, 2026 •

Copy link
Copy Markdown

Issue for this PR

Fixes #49451

Related to #8751.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Workspace Agent, Skill, and Command definitions were cached for the lifetime of a project instance. Editing an agent model or SKILL.md could therefore update the file preview while subsequent invocations continued using the old configuration.

This change reloads disk-backed configuration resources as consistent workspace revisions. New task dispatches and Skill/Command lookups use the latest valid revision, while already running tasks retain the revision they started with. Additions, removals, renames, configured skill paths, and source precedence are reflected without restarting the project.

Invalid edits block affected new invocations and recover after the file is repaired instead of silently using stale configuration. Desktop Agent and Command catalogs refresh after a revision is published.

JavaScript plugins, MCP connections, and provider clients are not reloaded by this change. Changes to those resources are reported as requiring a restart.

How did you verify your code works?

  • Changed a subagent model from model A to model B and verified the next provider request in the same parent session used model B.
  • Verified a running subagent retained its original model and instructions while configuration files changed.
  • Edited SKILL.md and verified both the Skill tool and slash command used the new content without rewriting earlier messages.
  • Tested additions, removals, renames, source precedence, invalid edits, recovery, repeated saves, and workspace isolation.
  • Tested catalog refreshes and protection against stale asynchronous responses.
  • Manually verified the behavior in OpenCode Desktop without restarting the application or reopening the project.

Screenshots / recordings

N/A — this changes runtime and catalog synchronization behavior without changing the visual interface.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slash skill commands do not reload edited SKILL.md content

1 participant