Skip to content

Skill file changes (add/remove/edit) not picked up until app restart due to never-evict in-memory cache #34443

Closed as not planned

Description

@vokasug

Description

When a SKILL.md file is added, removed, or edited on disk, the change is not reflected in new chat sessions. The stale skill list persists until the entire desktop application is restarted. Starting a "new session" is not sufficient.

Root cause

In \packages/core/src/skill.ts, skill discovery results are cached in an in-memory \Map\ that is never invalidated:

\\ s
const cache = new Map<string, Info[]>()

const list = Effect.fn("SkillV2.list")(function* () {
const skills = new Map<string, Info>()
for (const source of state.get().sources) {
const key = Source.key(source)
const loaded = cache.get(key) ?? (yield* load(source))
cache.set(key, loaded)
// ...
}
return Array.from(skills.values())
})
\\

  • \load(source)\ scans directories and parses \SKILL.md\ files (frontmatter + body) into \Info\ objects — once per source key
  • On subsequent \list()\ calls (including across new sessions), the cached result is returned unchanged
  • There is no TTL, no file watcher invalidation, no cache clearing on session creation
  • The desktop app runs opencode as a long-lived server process — sessions share the same in-memory cache

A developer TODO in the same file already acknowledges this gap:

\
// QUESTION(Dax): Should local skill sources invalidate on filesystem watch
// events, following the reload policy chosen for other context sources?
\\

Steps to reproduce

  1. Open OpenCode Desktop
  2. Create, delete, or edit a \SKILL.md\ file (e.g. in .opencode/skills/my-skill/)
  3. Start a new chat session — the skill list (<available_skills>) is unchanged
  4. Quit and restart the desktop app entirely — the change is now visible

Expected behavior

Skill file changes (add, remove, edit) should be reflected when starting a new session, without requiring a full application restart.

Proposed fix

At minimum, clear or invalidate the skill cache when a new session is created. Ideally, watch skill directories for filesystem changes and invalidate affected source entries on add/remove/modify events.

Environment

  • OpenCode Desktop for Windows
  • Also affects any setup where the opencode server process persists across sessions

Activity

  1. github-actions commented on Jun 29, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Please review those issues and consider whether this can be resolved there.

  2. github-actions commented on Aug 29, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions