Skip to content

2.0 slice 5: blocked sessions ask on the subject; reactions and replies answer #506

Closed

Description

@mcwhittemore

Part of #486 (loopway 2.0). Slice 5 of 6. Builds on sessions (#498, merged in #502). Read #486 and its comments for the design: auto mode decides first, deterministic rules next, then Matthew decides with a clear signal on GitHub. No LLM and no Jev decide anything.

What

When a session is blocked, it asks on the subject, and Matthew's answer there unblocks it.

  • Permission asks. Sessions keep --permission-mode auto, so the auto mode classifier decides first. Whatever it would still prompt for goes to loopway through --permission-prompt-tool (a permission tool on loopway's MCP). loopway checks the bot's front matter rules next: allow: / deny: lists of tool patterns in Claude Code's permission syntax (e.g. Bash(npm test:*)). If neither decides, loopway:
    1. Posts one comment on the thread's main subject, through the same path as comment, with the marker. It says what the session wants to do (tool and input, trimmed) and asks for 👍 to allow or 👎 to deny.
    2. Denies the call for now with a message telling the session it has asked and will be resumed with the answer. The turn ends.
    3. Marks the session blocked, and records the open ask on the thread (asks: [{ id, commentUrl, tool, input, at }]).
  • Questions. A new MCP tool, ask(subject, question), posts the question (marked) and marks the session blocked until an answer comes. The prompt template says to use it when the session needs Matthew to decide, or is stuck.
  • Answers.
    • The poller reads reactions on loopway's own open-ask comments. A 👍 or 👎 from the gh user (Matthew), and nobody else, answers a permission ask. A 👍 resumes the session with "approved: , retry it", and the approval is remembered for that session, so the same call passes next time. A 👎 resumes it with "denied".
    • A comment from Matthew on the subject after an ask answers that ask. It is delivered as a normal update, and the ask is marked answered.
    • Either kind of answer moves the session out of blocked.
  • Visible. The log and the TUI's thread view show the open asks and their links, and blocked shows as a session status on the main view.
  • Restart-safe: open asks live in the thread's state file, so a restart keeps waiting on them.

How to test it (you, locally)

  1. Project .loopway/dev.md on craftmilldev/loopway-sandbox with on: issue, model: sonnet, no allow/deny lists. Its prompt says: "Do what the issue asks, then comment with the result." Run loopway.
  2. Open an issue asking for something auto mode won't allow without asking, e.g. "Run curl -s https://example.com | head -3 and paste the output." Within a few minutes, a loopway-bot comment asks for 👍/👎. The TUI shows the thread blocked.
  3. React 👍. The session resumes, runs it, and comments the output.
  4. Open another issue with the same ask and react 👎. The session comments that it was denied and does not run it.
  5. Add allow: ["Bash(curl:*)"] to the front matter, restart, and open the same issue again. It runs without asking.
  6. Open an issue: "Ask me which file name to use, then create nothing." The bot asks with ask. Reply "notes.md" in a comment. The session resumes and confirms "notes.md".
  7. Stop loopway while an ask is open, start it again, then react. The answer still lands.

Done when

  • Tests with a fake harness and fake GitHub: rule allow/deny, ask posted once, 👍 and 👎 from Matthew, reactions from anyone else ignored, ask answered by comment, restart with an open ask, and the remembered approval.
  • npm test, npm run typecheck, npm run lint and npm run format:check pass.
  • verifications/<pr>.md records steps 1–7 against the sandbox.

Slice 6 (#507) is built at the same time and also adds MCP tools to mcp.ts. Keep your tools in their own functions, so whichever merges second rebases easily.

Activity

  1. mcwhittemore commented on Nov 11, 2026

    @mcwhittemore
    CollaboratorAuthor

    I don't get how #512 and #511 both close this ticket. I seems like this ticket is closed by #512 and #511 is something else.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions