Skip to content

Track dynamic skill discovery + prompt refresh on session resume #70

@dcramer

Description

@dcramer

Summary

When skills are defined outside the static system prompt (for example via SKILL.md files), the agent runtime needs a reliable way to detect added/removed/updated skills and refresh injected instructions on the next model call (including resumed sessions).

Problem

Today it is unclear whether skill updates require manually editing the base system prompt or adding an additional assistant message. That creates ambiguity and stale behavior risk.

Proposed Direction

Treat skills as external runtime state and rebuild instruction payloads per turn (or at least on resume):

  • Maintain a skill registry snapshot (name, path, mtime and/or content hash).
  • Before each run/resume, scan for changes and compute added/removed/changed.
  • Recompose injected system/developer instructions from the latest registry.
  • Keep full skill docs lazy-loaded; inject only relevant summaries by default.

Why

Models do not auto-discover filesystem changes from prior context. Prompt reconstruction in orchestration is the deterministic mechanism for freshness.

Acceptance Criteria

  • Runtime detects skill file changes without manual prompt edits.
  • Resume flow refreshes skill registry before first post-resume model call.
  • Added/removed/changed skills are reflected in the next injected instructions.
  • Optional observability event/log for "skill registry refreshed" with delta counts.
  • Tests cover initial load, update, add, remove, and resume refresh path.

Open Questions

  • Refresh cadence: every turn vs. resume + file-watch invalidation?
  • Cache boundaries: per session vs. global registry snapshot?
  • Should refresh deltas be surfaced to end users or logs only?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions