Skip to content

[FEATURE]: Show active session skills in the UI (sidebar, like MCP/TODO/LSP) and keep the model aware of them during the session #1

Open

Description

@AlexKay28

Describe the enhancement you want to request

Problem

Today, opencode's interface already surfaces important session state on screen: connected MCP servers, the agent's TODO list, LSP status. But skills — arguably one of the most important harness components — are invisible once a session starts. The only way to see them is the one-shot /skills picker (anomalyco#7846), and after that there's no persistent indication of which skills are attached to the session.

This causes two real problems:

  1. For the user: I can't tell at a glance which skills are active in the current session. If a skill isn't firing, I have no idea whether it's even loaded.
  2. For the model: In long sessions, the model loses track of available skills. Skills get mentioned in the system context early on, but as the conversation grows, the model "forgets" they exist and doesn't invoke the skill tool even when the task clearly matches a skill's trigger description. It ends up reinventing workflows the skill already encodes.

Proposed solution

UI side (visible in TUI/web/desktop):

  • Add an "Active skills" panel to the right sidebar / status area, alongside the existing MCP, TODO and LSP indicators, listing the skills attached to the current session (name + source, e.g. project .opencode/skills/ vs global ~/.config/opencode/skills/ vs plugin-provided).
  • Make each entry indicate its state: available vs invoked this session.
  • Clicking/selecting an entry could show its description and trigger conditions.

Harness side (the more valuable half of this request):

  • Actively re-assert loaded skills during the session so the model doesn't drift away from them. Options to consider:
    • inject a compact "active skills" reminder into the context periodically or on compaction (skills are especially likely to be dropped during context compaction);
    • or include a short skills availability line in tool-result/system context so late-session turns still see "you have these skills available and should use the skill tool when a task matches".

This would be a genuine harness improvement, not just cosmetics: skills only help if the model actually remembers to use them.

Related (checked before filing)

Happy to test early builds — I run a skill-heavy setup and hit the "model forgot the skill" problem regularly.

Activity

  1. AlexKay28 commented on Sep 10, 2026

    @AlexKay28
    OwnerAuthor

    Resolution plan (proposal)

    Explored the codebase on my fork (dev branch). Everything needed already has extension points — this is smaller than it looks.

    Codebase findings

    What Where Note
    Sidebar panels (MCP, LSP, todo, files) packages/tui/src/feature-plugins/sidebar/*.tsx each registers a sidebar_content slot with an order
    Skills listing endpoint client.skills() (SDK) already used by packages/tui/src/component/dialog-skill.tsx
    Skill context injection packages/opencode/src/session/system.ts:107 (SystemPrompt.skills) verbose skill list injected into system prompt once at session start
    Compaction packages/opencode/src/session/compaction.ts:31 PRUNE_PROTECTED_TOOLS = ["skill"] protects skill tool calls, but the availability list is not re-asserted after compaction

    Phase 1 — UI: "Skills" sidebar panel (TUI)

    1. New packages/tui/src/feature-plugins/sidebar/skills.tsx, modeled on sidebar/lsp.tsx:
      • register sidebar_content slot (order ~ after MCP/LSP)
      • data via props.api.client.skills(); collapsible section like LSP panel
      • each entry: • name + muted source hint (project / global / plugin) derived from location
      • empty state: "No skills discovered" (mirrors LSP wording)
    2. Invoked-this-session marker: subscribe to client events, watch skill tool calls, show ✓ on skills already invoked. Gives "available vs used" at a glance.
    3. Register the plugin in the TUI builtins list next to the other sidebar panels.

    Phase 2 — Harness: keep the model aware of skills

    1. Compaction retention (session/compaction.ts): extend the compaction summary prompt to explicitly retain the available-skills list in the summary output (the skill tool calls are already prune-protected; the list itself is what drifts).
    2. Post-compaction re-assertion: after a compact boundary, prepend a one-line reminder (<skills_available>name: description…</skills_available>) to the first context rebuild, so the model re-anchors without a full verbose re-injection. Implementation candidate: a context source / part of compact output in session/.
    3. Config toggle under opencode.json (e.g. skills.sidebar: true, skills.reminder: "auto"|"off") + schema regeneration.

    Phase 3 — polish & verification

    1. Docs: document the panel + reminder behavior on the skills docs page.
    2. bun typecheck in packages/opencode and packages/tui (never tsc directly, never from root).
    3. Manual verify via bun dev in packages/opencode inside tmux (per repo AGENTS.md), screenshot the sidebar with a skill-heavy workspace.

    Out of scope (separate issues)

  2. AlexKay28 commented on Sep 10, 2026

    @AlexKay28
    OwnerAuthor

    Progress — both phases implemented on branch session-skills-sidebar

    Phase 1 (UI, TUI sidebar) — verified live: panel renders between MCP and LSP, showing every discovered skill with its source tag (built-in / project / global / external), and a ✓ marker once the model invokes it in the session.

    • packages/plugin/src/tui.ts — TuiSidebarSkillItem type + TuiState.skills()
    • packages/tui/src/context/sync.tsx — skills store field, fetched at bootstrap via the existing /skill endpoint
    • packages/tui/src/plugin/adapters.tsx — stateApi.skills()
    • packages/tui/src/feature-plugins/sidebar/skills.tsx — new panel (slot order 250, collapsible, invoked-this-session tracking from message parts)
    • packages/tui/src/feature-plugins/builtins.ts — registered

    Phase 2 (harness: model doesn't forget skills) — compaction now re-asserts skills inside the conversation:

    • packages/opencode/src/session/compaction.ts — the compaction prompt gains a <session_skills> block instructing the summarizer to carry the available-skills list into the summary's Important Details (the summary is what persists post-compaction), and the auto-continue follow-up message appends an explicit "these skills are still available" line. Permission-filtered via skill.available(agent).
    • Rationale: the system prompt already re-injects skills every turn; the forgetting is attention drift, so the reminder is placed at the compaction boundary in-flow, where recency wins.

    Verification: bun typecheck green in packages/plugin, packages/tui, packages/opencode (incl. fixture update for the new required state accessor). Live TUI run confirmed the panel with 23 skills from real discovery.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions