feat(cli): add /reload to rescan on-disk extensions#189
Merged
emal-avala merged 1 commit intomainfrom Apr 23, 2026
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
3beb487 to
58c4fed
Compare
Re-reads skills, subagent definitions, hooks, and MCP servers from disk, prints a one-line summary, and invalidates the cached system prompt so the next turn picks up any changes. /reload Reloaded: 27 skill(s) · 3 agent(s) · 0 hook(s) · 2 MCP server(s) System prompt cache cleared; changes take effect on next turn. Useful during skill development — edit a skill file, run /reload, and the next /<skill> or model-driven invocation sees the new body without restarting the REPL. Adapted from Claude Code's /reload-plugins. QueryEngine gains a public `reset_system_prompt_cache()` helper so other commands that mutate prompt inputs can invalidate cleanly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
New
/reloadslash command that re-reads skills, subagent definitions, hooks, and MCP servers from disk, prints a one-line summary, and invalidates the cached system prompt so the next turn picks up any changes.Why
Previously, after editing a skill / agent file on disk the user had to restart the REPL to see the change reflected in
/skillsor in a/<skill>invocation. For a tight authoring loop that's unacceptable — the whole point of session persistence is to keep developing without re-establishing context.QueryEnginealready re-reads skills / rules from disk duringbuild_system_prompt, but the prompt itself is cached keyed on a hash of its inputs./reloadclears that cache so the next turn rebuilds unconditionally.Implementation
crates/cli/src/commands/mod.rsQueryEngine::reset_system_prompt_cache()— public helper for any future commands that mutate prompt inputsScoped to the extension surfaces agent-code actually supports. A companion bump to include rules can follow once #186 lands.
Test plan
cargo fmt --all— cleancargo clippy --workspace --all-targets -- -D warnings— cleancargo test -p agent-code --test smoke— 3/3 passcargo test -p agent-code-lib --lib— 615/616 pass (pre-existing sandbox test failure, unrelated)./target/debug/agent --help | grep reloadshows the command