Skip to content

feat(agent): add interactive /plan and /build modes with plan artifact approval - #119

Open
Ammar-create wants to merge 5 commits into
ExTV:masterfrom
Ammar-create:feat/agent-plan-mode
Open

Ammar-create wants to merge 5 commits into
ExTV:masterfrom
Ammar-create:feat/agent-plan-mode

Conversation

@Ammar-create

Copy link
Copy Markdown

Summary

This PR introduces an interactive Plan Mode vs Build Mode workflow to the agent, inspired by developer tools like Claude Code and Cursor Composer, adapted cleanly to RikkaHub's native Android experience.

Key Changes

  1. State & Mode Management ()

    • Introduces tracking (default) and modes per conversation.
    • Provides reactive so the UI and completions re-evaluate dynamically.
    • Enforces : hard write-lock on mutating tools (, , , , screen interactions) while allowing read/search tools (, , , , ).
  2. Slash Command Completion Provider ()

    • Plugs into alongside .
    • Context-aware filtering:
      • When in Build Mode, typing only suggests (). is never shown.
      • When in Plan Mode, typing only suggests (). is never shown.
  3. Composer Command Interception ()

    • Typing or and pressing Send switches mode instantly with feedback toast and zero token consumption.
    • Mode persists for all subsequent turns until switched back.
    • Inline commands (e.g., ) switch mode and deliver the prompt in one turn.
  4. Interactive Plan Artifact Tool ( in )

    • Tool callable by the agent in Plan Mode once investigation is complete.
    • Accepts , , , and .
    • Requires explicit user approval before execution resumes.
    • Approving the plan automatically transitions the conversation to mode.
  5. Plan Card UI Renderer ()

    • Inline expandable card following existing patterns:
      • Header with plan title.
      • Formatted steps overview and rendered markdown block.
      • Accept Plan ( with ): approves and transitions conversation to Build mode.
      • Decline ( with ): opens reason dialog for feedback so the agent can revise the plan in Plan mode.
      • Clean state badges ("Plan Approved · Switched to Build mode", "Plan Declined").
      • 100% native HugeIcons and Material 3 design, zero emojis.
  6. Unit Tests & CI

    • Unit tests for mode transitions, safe tool filtering, and slash completion behavior in and .
    • GitHub Actions workflow () to automatically compile and verify debug APKs.

ammar added 5 commits October 10, 2026 19:01
…t approval

- Add ConversationAgentMode tracking per-conversation BUILD and PLAN states
- Add SlashCommandCompletionProvider: only suggests /plan in Build mode, only suggests /build in Plan mode
- Add propose_plan interactive tool with inline expandable card, Accept Plan and Decline buttons
- Hard write-lock and system prompt guidance when in Plan mode
- Intercept /plan and /build commands in ChatPage composer with instant mode switching
- Zero emojis; strictly follows native HugeIcons and Material 3 design

This branch has not been deployed

No deployments
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