Skip to content

fix: make inline /command references actionable instead of dismissive - #121

Merged
elkaix merged 1 commit into
mainfrom
fix/inline-command-actionable-guidance
Jun 12, 2026
Merged

fix: make inline /command references actionable instead of dismissive#121
elkaix merged 1 commit into
mainfrom
fix/inline-command-actionable-guidance

Conversation

@elkaix

@elkaix elkaix commented Jun 12, 2026

Copy link
Copy Markdown
Member

Problem

When a user references a slash command mid-message — e.g. "ok your /goal today is to /plan and complete execute this [task]" — the command does not auto-run (a slash command only executes as its own message starting with /). Two real exported sessions showed the failure mode:

  • The agent led its reply by reporting the commands as failed ("they did not run as slash commands; send /goal … as its own message") before doing the work, which reads as a refusal.
  • One model (GPT-5.5) separately burned reasoning doubting whether EnterPlanMode was even a callable tool ("it's included as text rather than a callable function, which is confusing") — it is a real registered tool (tools/plan/enter.py), only filtered out when already in plan mode.

Why not mechanically execute the inline commands

A parser-based "split the message and run each command" approach was prototyped and rejected: parsing that real prompt attributes /goal args = "today is to" and /plan args = "[the entire task]", so it sets a nonsense goal and discards the actual task as throwaway args. No syntactic rule separates natural-language "/goal … /plan" from genuine command intent — only meaning does. So this fix is agent-mediated.

Change

Strengthen the per-turn inline-command reminder (soul/dynamic_injections/inline_commands.py) and the standing guidance (agents/default/system.md) to act on the intent each reference expresses rather than report failure:

  • /plan → call the real EnterPlanMode tool (named explicitly as an available tool, not just prose)
  • /goal → pursue the described objective until verifiably done
  • /skill:<name> → load it via ReadSkill and apply it
  • other guidance commands → apply the equivalent guidance directly
  • mention invoking the literal slash command only when genuinely needed

Tests

  • tests/core/test_inline_command_provider.py — new test_reminder_is_actionable_not_dismissive asserts the reminder names EnterPlanMode, pursues the /goal objective, and does not instruct the agent to report the commands as "did not run". Existing phrase pins (NOT execute, ReadSkill, the commands inline: … list) still hold.
  • agents/default/system.md heading pin (**Inline /command references.**) preserved; test_default_agent.py green.
  • make check-pythinker-code green.

Follow-up to #120 (which covered the brew tap-trust, antenna blink, and export redaction fixes).

Summary by CodeRabbit

  • Bug Fixes

    • Inline slash commands (e.g., /plan, /goal, /skill:<name>) embedded mid-sentence are now properly executed instead of being treated as non-actionable text.
  • Documentation

    • Updated changelog and system guidance to clarify how inline command references are handled.
  • Tests

    • Added validation tests for inline command execution behavior.

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: aa2a5397-f35e-4a16-a2c1-bd835a59f642

📥 Commits

Reviewing files that changed from the base of the PR and between bff54f9 and b7d6143.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • src/pythinker_code/agents/default/system.md
  • src/pythinker_code/soul/dynamic_injections/inline_commands.py
  • tests/core/test_inline_command_provider.py

📝 Walkthrough

Walkthrough

The PR updates inline slash-command handling so mid-message /command references (like /plan, /goal, /skill:<name>) trigger corresponding tool behaviors instead of being treated as non-executable reminders. The reminder template receives explicit command-handling instructions, a test validates actionable behavior, and system prompt and changelog documentation are updated.

Changes

Inline slash commands become actionable

Layer / File(s) Summary
Reminder template and test
src/pythinker_code/soul/dynamic_injections/inline_commands.py, tests/core/test_inline_command_provider.py
The _REMINDER_TEMPLATE now includes granular instructions for handling inline /plan, /goal, and /skill:<name> references with explicit guidance on EnterPlanMode and ReadSkill invocation. Mock soul gains plan command; test test_reminder_is_actionable_not_dismissive validates the reminder includes actionable guidance and avoids dismissive "did not run" phrasing.
System prompt and changelog
src/pythinker_code/agents/default/system.md, CHANGELOG.md
System prompt "Inline /command references" section clarifies that mid-message command mentions express intent and must be acted on, with explicit handling for /plan and /skill:<name>. Unreleased changelog entry documents the shift from failure-prone acknowledgment to actionable command behavior.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

bug

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 70.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title follows conventional commits format (fix: description) and accurately reflects the main change: making inline slash-command references actionable rather than dismissive.
Description check ✅ Passed The PR description is comprehensive, explains the problem clearly, justifies the design decision (why not mechanical parsing), details the change, and documents tests. All template sections are addressed.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/inline-command-actionable-guidance

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

A slash command mentioned mid-message (e.g. "your /goal today is to /plan
and build the page") does not auto-run, and the agent was leading its reply
by reporting the commands as failed and telling the user to resend them —
while separately doubting whether EnterPlanMode was even a callable tool.

Strengthen the per-turn inline-command reminder and the standing system-prompt
guidance to act on the intent each reference expresses: call the real
EnterPlanMode tool for /plan (named explicitly as an available tool, not just
prose), pursue the described objective for /goal, load /skill:<name> via
ReadSkill, and apply equivalent guidance for other commands. Mention invoking
the literal slash command only when genuinely needed.

This is the agent-mediated fix for inline commands; mechanical message-splitting
was rejected because it mis-attributes args and discards the real task.
@elkaix
elkaix force-pushed the fix/inline-command-actionable-guidance branch from 0e9c2d9 to b7d6143 Compare June 12, 2026 04:53
@elkaix
elkaix merged commit 199cbe9 into main Jun 12, 2026
34 checks passed
@elkaix
elkaix deleted the fix/inline-command-actionable-guidance branch July 17, 2026 20:04
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