Skip to content

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

Merged
mcwhittemore merged 3 commits into
mainfrom
v2-slice-5-asks
Nov 11, 2026
Merged

mcwhittemore merged 3 commits into
mainfrom
v2-slice-5-asks

Conversation

@mcwhittemore

@mcwhittemore mcwhittemore commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #506. Slice 5 of loopway 2.0: when a session is blocked, it asks on the subject, and your answer there unblocks it. No model decides anything.

What it does

  • Permission asks. Sessions keep --permission-mode auto, so the classifier decides first. What it would still prompt for goes to a new permission tool on loopway's MCP (--permission-prompt-tool). loopway then checks, in order: calls you already approved for this session, the bot's deny: list, its allow: list (Claude Code's pattern syntax, Bash(npm test:*)). If none decides it posts one comment on the thread's main subject (through the same path as comment, marked) asking for a 👍 or 👎, refuses the call for now with a message saying it has asked, marks the session blocked, and records asks: [{ id, kind, commentUrl, subject, tool, input, at, answeredAt? }] on the thread.
  • Questions. A new ask(subject, question) tool posts the question (marked) and blocks the session. The ground rules tell sessions to use it when they need someone to decide or are stuck.
  • Answers. After each 30 s pass over the known subjects, loopway reads the reactions on its open permission asks (one conditional request per open ask). A 👍 or 👎 from the gh user, and nobody else, answers: 👍 resumes the session with approved: <tool> <input>, "Retry it." and remembers the call for that session, 👎 resumes it with denied. A comment from the gh user on the question's subject after the question answers it and is delivered as a normal update. A blocked session is not run for other updates meanwhile.
  • Visible. asked / answered lines in the log and --json, ?? asked lines in the session log, a "Waiting on" section with links in the TUI thread view, and blocked as the session status on the main view.
  • Restart-safe. Open asks are in the thread's JSON; a session that was blocked stays blocked, and a run cut off after it asked keeps its session id to be resumed.

New code is in asks.ts (rule matching, the comments, reading reactions); mcp.ts gets two tools in their own functions so slice 6 rebases easily.

Worth knowing

  • Reactions are read per open ask over REST with ETags (a 304 is free) rather than in one GraphQL call: GraphQL needs the comment's node id, which comment() does not return, and resource(url:) cannot read an issue comment's reactions.
  • The same call is matched without Claude's description field, which it rewords on every retry; otherwise a remembered approval would not match the retry.
  • In my sandbox runs the classifier allowed curl, a POST of /etc/hosts, writes outside the project, WebFetch and so on without prompting, so nothing reached the permission tool. To force a prompt I put permissions.ask: ["Bash(curl:*)"] in the scratch project's .claude/settings.json. Details in the verification file.

Test it locally

npm install && npm test && npm run typecheck && npm run lint && npm run format:check

packages/cli/test/asks.test.ts is the new file: rule matching and front matter, ask posted once, 👍 and 👎 from the owner, reactions from anyone else ignored, a question answered by a comment, restart with an open ask, the remembered approval, and the whole loop over MCP with test/fake-claude.mjs.

To try it live, follow steps 1 to 7 of #506. The result of doing that is in verifications/512.md.

🤖 Generated with Claude Code

@github-actions github-actions Bot added the conflicts Conflicts with its base branch; set and cleared by the Label merge conflicts workflow label Nov 11, 2026
@github-actions

Copy link
Copy Markdown

This PR conflicts with its base branch. Rebase onto it, resolve the conflicts, and push.

mcwhittemore and others added 3 commits November 10, 2026 22:37
…nd replies answer

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… call is the same without its description

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <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.0 slice 5: blocked sessions ask on the subject; reactions and replies answer

1 participant