Skip to content

gate:ask reports why the form cap forced a wait - #317

Merged
m4ttheweric merged 1 commit into
mainfrom
gate-cap-advisory
Sep 17, 2026
Merged

m4ttheweric merged 1 commit into
mainfrom
gate-cap-advisory

Conversation

@m4ttheweric

@m4ttheweric m4ttheweric commented Sep 17, 2026 •

Copy link
Copy Markdown
Collaborator

A caller whose question exceeds the in-pane form's 4-option cap used to get a bare "wait" back with no reason; that silence is why navigation-verb folding survived across the wrapper skills (three live specimens today: 5- and 6-option questions degrading gates to the wait queue).

When the pane and session would have supported a form and one or more questions exceed the cap, the gate:ask response now carries formCapExceeded ([{question, options}]) and formCapAdvisory naming the structural remedy, through both surfaces: the CLI prints the fields on stdout and one advisory line on stderr (mirroring contextOmitted), and the gate_ask MCP tool returns the same fields with the cap taught in its description. A pane-less ask waits for its own reason and carries no advisory. Never a refusal: an over-cap wait gate is legitimate (remote cards render any option count).

Verified: handler + CLI + MCP suites and the gate-ask e2e file green; rt-client dist rebuilt.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Gate questions with more than four options now include form-cap diagnostics, including the affected question and option count.
    • Oversized selections continue to open the gate while presenting a wait status with guidance for handling the choices.
    • Operators receive a warning detailing affected questions, available options, and recommended alternatives.
  • Documentation

    • Updated gate_ask guidance to describe the four-option in-pane limit and recommended question formats.

A caller whose question busts the in-pane form's 4-option cap used to
get a bare wait with no reason, which is how option-folding survived in
every wrapper skill. When the pane could have presented a form, the
response now carries formCapExceeded naming each over-cap question plus
the structural remedy, on the CLI (stdout field + stderr line, like
contextOmitted) and the gate_ask tool alike; the tool description
teaches the cap up front. Never a refusal: an over-cap wait gate stays
legitimate.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: e456e72c-aa01-49a1-b420-fc43f05b53e8

📥 Commits

Reviewing files that changed from the base of the PR and between 67fd19d and dd62b96.

📒 Files selected for processing (5)
  • commands/gate.ts
  • lib/daemon/__tests__/gate-ask-handler.test.ts
  • lib/daemon/handlers/gate.ts
  • lib/mcp/tools.ts
  • packages/rt-client/src/commands.ts

Included review availability: 0 reviews are currently available. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.


📝 Walkthrough

Walkthrough

The gate:ask flow now detects questions with more than four options in pane-backed sessions. It returns optional form-cap diagnostics, keeps the gate open, emits an operator warning, and documents the resulting wait presentation.

Changes

Gate Form-Cap Advisories

Layer / File(s) Summary
Response contract
packages/rt-client/src/commands.ts, lib/daemon/handlers/gate.ts
The gate:ask response now supports optional formCapExceeded and formCapAdvisory fields.
Cap detection and validation
lib/daemon/handlers/gate.ts, lib/daemon/__tests__/gate-ask-handler.test.ts
The daemon detects over-cap questions only when pane and session data exist. Tests cover over-cap, pane-less, and within-cap requests.
Operator output and tool guidance
commands/gate.ts, lib/mcp/tools.ts
The CLI prints affected questions and the advisory to stderr. The MCP description documents the four-option limit and wait outcome.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant MCPClient
  participant GateHandler
  participant GateCLI
  MCPClient->>GateHandler: send gate:ask questions
  GateHandler->>GateHandler: detect options above four
  GateHandler-->>MCPClient: return formCapExceeded and formCapAdvisory
  GateHandler-->>GateCLI: return gate response
  GateCLI->>GateCLI: print affected questions and advisory
Loading

Merge Risk: ⚪ Minimal · up to dd62b

The form-cap diagnostics are consistently represented across the handler, client contract, CLI, MCP guidance, and targeted tests. No merge-blocking issue remains.

🚥 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 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 5 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: gate:ask reports why the form-cap condition causes a wait.
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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

@m4ttheweric
m4ttheweric merged commit 05dbe0a into main Sep 17, 2026
4 checks passed
@m4ttheweric
m4ttheweric deleted the gate-cap-advisory branch September 17, 2026 18:48
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