Skip to content

Register bundled /deep-research into the REPL/TUI command surface - #267

Merged
ericleepi314 merged 2 commits into
mainfrom
fix/register-deep-research-slash-command
Jun 11, 2026
Merged

Register bundled /deep-research into the REPL/TUI command surface#267
ericleepi314 merged 2 commits into
mainfrom
fix/register-deep-research-slash-command

Conversation

@agentforce314

@agentforce314 agentforce314 commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Bug

Typing /deep-research … in a session did nothing useful: no autocomplete for /deep-, and the command "ran" as a bogus Skill call with the model narrating fake progress. /workflows likewise showed only a help listing.

Root cause

The workflow slash commands (/deep-research, /workflows) are produced by the command aggregator (get_commands()), but nothing consumes get_commands() for the actual command surface:

  • Suggestions (build_command_suggestions) source from a hardcoded builtin list + the global command registry + skills.
  • Dispatch (execute_command_async) reads the global command registry.

Both read the global registry, which register_builtin_commands populates — and the workflow commands were never registered there. So /deep-research was invisible to autocomplete and fell through to the model as raw text (which improvised a Skill call), and /workflows fell through to the help listing.

(All prior workflow testing drove run_workflow directly, never the slash-command path — so this gap wasn't caught.)

Fix

Surface the cwd-independent bundled workflow commands through get_builtin_commands(), gated by is_workflows_enabled() (mirrors the BUDDY_COMMAND pattern). They now register into the global registry that both suggestions and dispatch read:

  • /deep-research autocompletes and injects the "Call the Workflow tool with script_path…" directive (verified working end-to-end: the model launches the Workflow tool).
  • /workflows dispatches in the Rich REPL, reading runtime_tasks via the command context's tool_context to list running/recent runs. The TUI keeps its open_dialog fast-path (runs before registry dispatch); suggestions dedupe by name so /workflows isn't doubled.

Tests

tests/test_workflow_command_registration.py — present/absent by gate, both commands resolved by the global registry, the deep-research directive, and the /workflows viewer listing a run. 68 command-system tests pass.

Known follow-up (out of scope)

cwd-dependent project/personal workflows (.claude/workflows/*.py) still only live in the aggregator — a global singleton can't hold per-cwd commands; wiring those into the session needs a cwd-aware step.

🤖 Generated with Claude Code

agentforce314 and others added 2 commits June 10, 2026 19:07
The workflow slash commands (e.g. /deep-research) were produced by the
aggregator's get_commands(), but nothing consumes get_commands() for the
REPL/TUI command surface: suggestions (build_command_suggestions) and
dispatch (execute_command_async) read the GLOBAL command registry that
register_builtin_commands populates. So /deep-research had no autocomplete
and, when typed, fell through to the model as raw text — which improvised a
bogus "Skill" call — instead of injecting the Workflow-tool directive.

Surface the cwd-independent bundled workflow commands via
get_builtin_commands() (gated by is_workflows_enabled(), mirroring the
BUDDY_COMMAND pattern), so they register into the global registry both
suggestions and dispatch read. /deep-research now autocompletes and
dispatches its directive correctly.

cwd-dependent project/personal workflows remain the aggregator's concern
(a global singleton can't hold per-cwd commands) — a follow-up.

Tests: present-when-enabled / absent-when-disabled / resolved-by-global-
registry-with-Workflow-directive.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The /workflows list command was likewise absent from the global registry, so
the REPL fell through to the help listing instead of showing runs. Add
WORKFLOWS_COMMAND to bundled_workflow_commands() so it dispatches in the REPL
(reading runtime_tasks via the command context's tool_context). The TUI keeps
its open_dialog fast-path (runs before registry dispatch), and command
suggestions dedupe by name so /workflows isn't listed twice.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ericleepi314
ericleepi314 merged commit 87b85c5 into main Jun 11, 2026
peroxider pushed a commit to peroxider/clawcodex that referenced this pull request Jun 15, 2026
…oring keyword

Closes two gaps in the workflow-engine port (workflow-engine.md §4.1 + §4.7),
audited and planned in docs/workflow-commands-and-ultracode-plan.md.

1. Dynamic workflow slash commands were discovered but never dispatchable.
   load_workflow_commands fed only the aggregator's get_commands(), which has no
   real REPL consumers, so saved .claude/workflows/*.py never reached the global
   registry that dispatch + suggestions read (the same orphaning that hid
   /deep-research until agentforce314#267). Add load_and_register_workflows(registry=None) —
   mirroring load_and_register_skills, same shadowing guard (builtins/bundled
   win; project beats personal) — and call it at REPL (_init_command_system) and
   TUI (app.py) startup. Saved workflows now dispatch AND autocomplete (workflow
   tag). Confirmed end-to-end: a saved file that was `dispatch: False` is now
   registered, suggested, and tagged.

2. The `ultracode` authoring keyword (§4.1) was never built (0 hits in src/).
   New src/workflow/ultracode.py: the standalone `\bultracode\b` keyword in a
   prompt (one-shot) and `/effort ultracode` (session-long mode) append a
   <system-reminder> nudging the model to author a workflow via the Workflow tool
   instead of working turn by turn. Wired into REPL chat() (next to the
   companion-intro append) and effort_command.py. Gated by is_workflows_enabled()
   — §4.8: the keyword no-ops and the option leaves the /effort menu when off.
   (Python's effort pipeline is inert, so /effort ultracode contributes the
   orchestration mode only, not a reasoning level.)

Tests (48 new): saved-workflow registration + precedence + gating
(test_workflow_dynamic_commands.py); keyword detection, reminder precedence,
session toggle, and /effort ultracode (test_ultracode.py). Three base-effort
picker tests gated to workflows-off so they keep asserting the bare option set
(ultracode-in-menu is covered separately). Full sweep: 299 passed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
singlaamitesh pushed a commit to singlaamitesh/clawcodex that referenced this pull request Jul 7, 2026
…deep-research-slash-command

Register bundled /deep-research into the REPL/TUI command surface
singlaamitesh pushed a commit to singlaamitesh/clawcodex that referenced this pull request Jul 7, 2026
…oring keyword

Closes two gaps in the workflow-engine port (workflow-engine.md §4.1 + §4.7),
audited and planned in docs/workflow-commands-and-ultracode-plan.md.

1. Dynamic workflow slash commands were discovered but never dispatchable.
   load_workflow_commands fed only the aggregator's get_commands(), which has no
   real REPL consumers, so saved .claude/workflows/*.py never reached the global
   registry that dispatch + suggestions read (the same orphaning that hid
   /deep-research until agentforce314#267). Add load_and_register_workflows(registry=None) —
   mirroring load_and_register_skills, same shadowing guard (builtins/bundled
   win; project beats personal) — and call it at REPL (_init_command_system) and
   TUI (app.py) startup. Saved workflows now dispatch AND autocomplete (workflow
   tag). Confirmed end-to-end: a saved file that was `dispatch: False` is now
   registered, suggested, and tagged.

2. The `ultracode` authoring keyword (§4.1) was never built (0 hits in src/).
   New src/workflow/ultracode.py: the standalone `\bultracode\b` keyword in a
   prompt (one-shot) and `/effort ultracode` (session-long mode) append a
   <system-reminder> nudging the model to author a workflow via the Workflow tool
   instead of working turn by turn. Wired into REPL chat() (next to the
   companion-intro append) and effort_command.py. Gated by is_workflows_enabled()
   — §4.8: the keyword no-ops and the option leaves the /effort menu when off.
   (Python's effort pipeline is inert, so /effort ultracode contributes the
   orchestration mode only, not a reasoning level.)

Tests (48 new): saved-workflow registration + precedence + gating
(test_workflow_dynamic_commands.py); keyword detection, reminder precedence,
session toggle, and /effort ultracode (test_ultracode.py). Three base-effort
picker tests gated to workflows-off so they keep asserting the bare option set
(ultracode-in-menu is covered separately). Full sweep: 299 passed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

2 participants