Skip to content

fix: harden skill discovery and preserve loaded instructions - #193

Open
MelodyVAR wants to merge 1 commit into
mainfrom
fix/skill-loading-lifecycle
Open

MelodyVAR wants to merge 1 commit into
mainfrom
fix/skill-loading-lifecycle

Conversation

@MelodyVAR

Copy link
Copy Markdown
Collaborator

Skill loading had inconsistent behavior across discovery, invocation, and compaction: directory symlink cycles caused repeated traversal, --no-skills still scanned skill trees, nested ignore rules lost their scope, and multi-line /skill:name commands were not expanded. Step also advertised read when its active tool was read_file.

Fix discovery with canonical directory visitation and a shared directory-scoped ignore matcher. Skip automatic skill collection before traversal when disabled, while retaining explicit CLI paths and correctly identifying skills-only packages. Align the SDK helper with project-first precedence and accept BOM-prefixed skills in the execution-environment loader. Generate the catalog instruction for the active read tool and split skill commands on whitespace.

Built-in compaction now preserves actually loaded skill instructions independently of the generated summary. Successful reads and explicit invocations are recorded with their locations/read ranges, carried in compaction metadata, and appended verbatim to the resulting context. Full rereads replace older content, repeated ranges are deduplicated, and reused tool-call IDs are correlated in message order. Step's read/write/edit aliases also participate in file tracking. Custom compaction extensions retain ownership of their summaries.

Validation:

  • coding-agent full suite: 3514 passed, 55 skipped.
  • agent-core full suite: 465 passed, 1 skipped.
  • CLI full suite: 624 passed.
  • 27 focused regression cases cover discovery, invocation, encoding, precedence, and compaction, included in the counts above.
  • pnpm run build:offline passed.
  • All checks from pnpm run check passed, with Biome run without --write.
  • Isolated two-self-symlink probes complete for the low-level loader, the full resource loader, and --no-skills; the full loader completes in about 50ms where the original exceeded a 3s external scan limit.

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.

1 participant