Skip to content

fix(gateway): /kanban must not raise on unbalanced quotes in args - #94571

Open
Sahilvishnaliya wants to merge 1 commit into
NousResearch:mainfrom
Sahilvishnaliya:fix/kanban-slash-unbalanced-quote
Open

Sahilvishnaliya wants to merge 1 commit into
NousResearch:mainfrom
Sahilvishnaliya:fix/kanban-slash-unbalanced-quote

Conversation

@Sahilvishnaliya

Copy link
Copy Markdown
Contributor

Problem

The /kanban handler called shlex.split(text) bare. Any unbalanced quote in user-typed args — "/kanban deploy \"v2", or a first-token apostrophe like don't opening a quote per POSIX parsing — raised ValueError: No closing quotation straight out of the slash handler.

Every other shlex.split site in the gateway guards this exact failure:

  • /resume (slash_commands.py:4876-4879): try/except ValueError → parse-error message
  • run.py profile-arg parser (:9482-9485): try/except → whitespace-split fallback
  • run.py home-detection (:30618-30621): same fallback

Fix

Mirror the established fallback: on ValueError, split on whitespace so the command still runs (quote-grouping lost, which is the correct degradation for malformed input).

Verification

Swept all gateway/plugin shlex.split( call sites — this was the only unguarded one; module parses clean.

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard comp/gateway Gateway runner, session dispatch, delivery comp/lsp Language Server Protocol integration (P2 policy) comp/plugins Plugin system and bundled plugins comp/tui Terminal UI (ui-tui/ + tui_gateway/) tool/browser Browser automation (CDP, Playwright) tool/terminal Terminal execution and process management platform/dingtalk DingTalk adapter platform/discord Discord bot adapter platform/feishu Feishu / Lark adapter platform/matrix Matrix adapter (E2EE) platform/signal Signal CLI adapter platform/wecom WeCom / WeChat Work adapter platform/whatsapp WhatsApp Business adapter sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state labels Aug 25, 2026
@alt-glitch

Copy link
Copy Markdown
Contributor

This was generated by AI during triage.

Related to #76887 and #43503: this fixes the /kanban handler with whitespace fallback, while those address other slash-command paths and use different recovery behavior. This PR also contains many unrelated changes; please isolate the focused fix for review.

The /kanban handler called shlex.split(text) bare. Any unbalanced
quote in user-typed args (e.g. '/kanban deploy "v2', or an apostrophe
opening a quote) raised ValueError('No closing quotation') straight
out of the slash handler.

Every other shlex.split site in the gateway guards this: /resume
returns a parse-error message, and run.py's config parser falls back
to whitespace splitting. /kanban now uses the same whitespace-split
fallback.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/cli CLI entry point, hermes_cli/, setup wizard comp/gateway Gateway runner, session dispatch, delivery comp/lsp Language Server Protocol integration (P2 policy) comp/plugins Plugin system and bundled plugins comp/tui Terminal UI (ui-tui/ + tui_gateway/) P3 Low — cosmetic, nice to have platform/dingtalk DingTalk adapter platform/discord Discord bot adapter platform/feishu Feishu / Lark adapter platform/matrix Matrix adapter (E2EE) platform/signal Signal CLI adapter platform/wecom WeCom / WeChat Work adapter platform/whatsapp WhatsApp Business adapter sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state tool/browser Browser automation (CDP, Playwright) tool/terminal Terminal execution and process management type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants