Skip to content
PirefactorCLI & tooling

Scope a minimal fix for Alt+Enter slash-command queueing in pi coding agent

Session from pi-mono-sessions on Hugging Face by thomasmustier · MIT · condensed by Coders Talk

56msession
0interventions
GOAL

Investigate how to shrink a ~300-line proposed diff for queueing /compact, /reload and other slash commands via Alt+Enter into a smaller, maintainer-acceptable change, without touching code yet.

  1. Prompt · +0
    Investigate how to shrink a 300-line diff for queueing /compact, /reload etc. via Alt+Enter into a smaller, cleanly scoped change. Read only, don't touch code yet.
  2. Agent did · +0m
    Traced Alt+Enter follow-up handling, built-in slash command routing, AgentSession.prompt/steer, compaction queue, extension command registration and skill expansion across interactive-mode.ts, agent-session.ts, agent.ts, slash-commands.ts and extensions/runner.ts.
  3. Agent did · +21m
    Summarized current architecture: Alt+Enter follow-up bypasses the interactive built-in command router, so built-ins like /compact get queued as plain text and later sent to the model.
  4. Prompt · +30m
    Yes let's do that
  5. Agent did · +36m
    Dug into isCompacting, waitForRetry and auto-compaction flow to understand where a queued built-in command would need to hook in.
  6. Agent did · +39m
    Drafted a minimal 'Option A' PR scope: on Alt+Enter during streaming/compaction, detect built-in slash commands, refuse to queue them as text, warn instead, and keep editor content intact.
  7. Break · 1h 52m away, not counted
  8. Prompt · +39m
    Let's do Option C instead — try to actually resolve this properly. Only exception: if Option C naturally builds on A, do one commit for A and a second for C.
  9. Agent did · +40m
    Investigated onInputCallback, getUserInput, restoreQueuedMessagesToEditor and existing follow-up/queue tests to find where a minimal post-turn command queue for Option C could attach without touching agent-core or extension APIs.
  10. Outcome · +56m
    No code changed; ended with an agreed two-commit plan — Commit 1 (Option A) blocks queueing built-in slash commands as text via Alt+Enter, Commit 2 (Option C) adds a minimal post-turn command queue/flush scoped to InteractiveMode only.
VERDICT

Next time I'd open by naming the target diff size and the exact commands in scope up front, since that framing is what pushed the agent toward a maintainer-friendly two-commit split instead of one big change. Pushing back with 'let's do Option C, but build it on Option A if possible' was the correction that actually shaped a scoped, reviewable plan rather than a monolithic feature. No code was written this session — it was pure investigation and scoping, which is exactly what I asked for.

I tried this · 0

Discussion · 0

How Builds work