Skip to content

feat(skill): add read_skill tool for inline skill loading in plan mode#3515

Closed
yhemeo613 wants to merge 1 commit into
esengine:main-v2from
yhemeo613:feature/rewind-command
Closed

feat(skill): add read_skill tool for inline skill loading in plan mode#3515
yhemeo613 wants to merge 1 commit into
esengine:main-v2from
yhemeo613:feature/rewind-command

Conversation

@yhemeo613

Copy link
Copy Markdown
Contributor

Problem

run_skill is classified as a writer tool (ReadOnly() = false) because subagent skills can spawn isolated loops that call writer tools. This blocks ALL skill usage in plan mode, even for inline skills which are purely informational and have zero side effects.

Fixes #3491

Solution

Add read_skill — a read-only counterpart that only loads inline skill bodies:

  • ReadOnly() returns true → callable in plan mode
  • Rejects subagent skills with a clear message directing to run_skill instead
  • Same name/arguments schema as run_skill for easy migration
  • Added to SubagentMetaTools() exclusion list so sub-agents don't inherit it

Changes (7 files, +122/-5)

File Change
internal/skill/tools.go Add readSkillTool + NewReadSkillTool (+80 lines)
internal/skill/tools_test.go 4 new tests: inline load, subagent rejection, unknown name, empty args
internal/boot/boot.go Register read_skill in tool registry
internal/agent/task.go Add read_skill to meta-tool exclusion list
internal/skill/index.go Mention read_skill in skills index header
internal/skill/skill_test.go Update meta-tool list in test
internal/agent/task_test.go Update meta-tool assertions

Testing

go test ./internal/skill/... ./internal/agent/... ./internal/boot/... ./internal/tool/...

All pass (97s agent suite, 4 new read_skill tests).

Adds parseRewind helper and wires /rewind into Controller.Submit() so all
frontends (TUI, desktop, HTTP) can trigger checkpoint-based rollback.

Usage:
  /rewind                    → rewind to latest checkpoint (both)
  /rewind <turn>             → rewind to specific turn (both)
  /rewind <turn> <scope>     → rewind with explicit scope
    scope = code | conversation | both

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development agent Core agent loop (internal/agent, internal/control) and removed v2 Go rewrite (1.x) — main-v2 branch, active development labels Jun 8, 2026
@esengine

Copy link
Copy Markdown
Owner

Closing: this branch contains a /rewind implementation, which already shipped to main-v2 via #3186 (internal/control/controller.go has parseRewind and the /rewind switch arm) 鈥?and the PR description describes a read_skill tool that isn't in the diff, so it looks like the wrong branch got pushed. #3491 is still a real ask: if you have the read_skill implementation, please open a fresh PR from a branch cut off current main-v2.

@esengine esengine closed this Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent Core agent loop (internal/agent, internal/control)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: run_kill is writer tool

2 participants