Skip to content

feat(cli): make a level 2 hook answer require action on Cursor, OpenCode, Kilo and Antigravity #1350

Backlog

Description

@blafourcade

Problem

A hook at level 2 ("require": the model must deal with the message before going on) only informs on Cursor, OpenCode, Kilo and Antigravity: the adapters append context and nothing makes the model act. A check of raw docs and source shows each host documents a way to do more:

  • Cursor (hooks): no post-tool block, but stop returns followup_message ("Cursor will automatically submit it as the next user message", capped by loop_limit), and preToolUse can deny the next tool call with agent_message ("Message fed back to the agent when the action is denied"). Also at risk: forum reports (thread) say postToolUse additional_context never reaches the model for built-in tools, which would break level 1 too.
  • OpenCode V2 (source packages/schema/src/session-inbox.ts, packages/core/src/plugin/provider/opencode-watches.ts): ctx.session.synthetic({ text, delivery: "steer" }) "delivers before the agent's next model call, even mid-work"; OpenCode's own plugin does it from execute.after. experimental.idle keeps the turn going with a synthetic message.
  • Kilo (source packages/opencode/src/session/prompt.ts): client.session.promptAsync from a plugin queues a prompt that takes over after the current step; the original turn ends as superseded, and the person sees the prompt.
  • Antigravity (hooks): PostToolUse answers {}, but PreInvocation "fires before the model is called" and can inject a systemMessage; PostInvocation has terminationBehavior: "force_continue".

Proposed solution

Probe first, in a sandbox (throwaway HOME and project, free models, chats deleted), then wire only what the probe proves:

  1. Cursor: does postToolUse additional_context reach the model (built-in tools vs MCP)? Does the preToolUse deny loop make the model fix first?
  2. OpenCode V2: does a steer synthetic from execute.after reach the model mid-turn? Decide the bridge's V2 target.
  3. Kilo: promptAsync from tool.execute.after: deadlock or double run? What does a thrown error look like to the model?
  4. Antigravity: does PreInvocation fire before each model call within a turn, and does its systemMessage reach the model (CLI and IDE)?

Acceptance criteria

  • One probe per question, recording host version and invocation.
  • Each proven mechanism wired in its adapter or bridge and tested from a captured payload.
  • Each unproven one stated as a limit in docs/COMPATIBILITY.md.
  • If Cursor level 1 is broken, it is stated as a limit at once.

Content type

CLI

Activity

  1. blafourcade commented on Nov 26, 2026

    @blafourcade
    ContributorAuthor

    Partly delivered on next: OpenCode and Kilo queue a required finding as the next prompt (#1378). Antigravity: the PreToolUse deny route works (#1370), and the PostToolUse to PreInvocation relay is proven on gemini-4-hydrogen-low and ready on branch feat/antigravity-level-two-relay. It is not merged, because no shipped script answers level 2 after a tool yet. Cursor remains unprobed (usage limit). Left open.

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

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions