Skip to content

feat(cli): add /reload to rescan on-disk extensions#189

Merged
emal-avala merged 1 commit intomainfrom
feat/reload
Apr 23, 2026
Merged

feat(cli): add /reload to rescan on-disk extensions#189
emal-avala merged 1 commit intomainfrom
feat/reload

Conversation

@emal-avala
Copy link
Copy Markdown
Member

@emal-avala emal-avala commented Apr 23, 2026

Summary

New /reload slash 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.

> /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.

Why

Previously, after editing a skill / agent file on disk the user had to restart the REPL to see the change reflected in /skills or 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.

QueryEngine already re-reads skills / rules from disk during build_system_prompt, but the prompt itself is cached keyed on a hash of its inputs. /reload clears that cache so the next turn rebuilds unconditionally.

Implementation

  • New slash command in crates/cli/src/commands/mod.rs
  • QueryEngine::reset_system_prompt_cache() — public helper for any future commands that mutate prompt inputs
  • Counts are computed by re-reading the same files the system-prompt builder and coordinator read at startup

Scoped to the extension surfaces agent-code actually supports. A companion bump to include rules can follow once #186 lands.

Test plan

  • cargo fmt --all — clean
  • cargo clippy --workspace --all-targets -- -D warnings — clean
  • cargo test -p agent-code --test smoke — 3/3 pass
  • cargo test -p agent-code-lib --lib — 615/616 pass (pre-existing sandbox test failure, unrelated)
  • Manual: ./target/debug/agent --help | grep reload shows the command

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@emal-avala emal-avala force-pushed the feat/reload branch 6 times, most recently from 3beb487 to 58c4fed Compare April 23, 2026 04:20
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.
@emal-avala emal-avala merged commit 317def5 into main Apr 23, 2026
14 checks passed
@emal-avala emal-avala deleted the feat/reload branch April 23, 2026 04:27
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