Skip to content

fix: post OMP ask questions to the room instead of aborting the turn - #795

Open
bandzalkin wants to merge 10 commits into
band-ai:mainfrom
bandzalkin:feat/omp-room-ask
Open

bandzalkin wants to merge 10 commits into
band-ai:mainfrom
bandzalkin:feat/omp-room-ask

Conversation

@bandzalkin

@bandzalkin bandzalkin commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #763. The native OMP adapter exists only in #763, so this diff includes #763's commits until it merges. This PR's change is the top commit, feat(omp): route the native ask tool to the room (de52cbf8).

Why

Every OMP turn that used OMP's built-in ask tool was aborted. Without the structured ask dialog, ask reaches the host as select/editor UI requests, which OmpAdapter can only cancel. OMP treats a cancelled ask as the user interrupting the turn (prompt_result: aborted), so the room got "Internal error while processing message" and the message was marked failed. This happened in production when a model called ask alongside band_send_message.

What

ask is now answered through the room, using the same turn split as Copilot's ask_user="room". Band processes a room's messages one at a time, so the turn cannot block waiting for the answer.

  • Opt in per session. _open_room sends set_ask_dialog {enabled: true} and fails startup if OMP refuses. OMP ≥ 18.8.9, the documented minimum, supports it.
  • Post and acknowledge. An ask request goes to OmpAdapter._ask_room. It posts the questions, options, descriptions and recommendation to the room through deliver_reply, mentioning the requester, and that post is the turn's reply. Each question is answered immediately with customInput text telling the model the answer arrives as a later message. The participant's reply resumes the same native session.
  • Failure paths. If the room post fails, the model is told so and the turn still owes a reply. A stopped room (RoomExecutionStoppedError) still ends the turn.
  • Wire models. Adds OmpAskQuestion, OmpAskOption and OmpAskAnswer, plus OmpUIRequest.questions and OmpUIResponse.answers. recommended accepts any number, matching OMP's schema.
  • Shutdown guard. Once shutdown begins, OmpRpcClient._start_callback refuses new host-tool and UI callbacks. Before, a callback arriving after cleanup ran with no owner and could still post to the room.
  • Guidance and docs. The system prompt explains the ask turn split, and docs/acp.md documents the behavior.

Scope

OMP's ask tool reached the adapter as select/editor prompts it could only
cancel, and OMP treats a cancelled ask as the user interrupting the turn, so
any model call to ask aborted the whole prompt and failed the room message.

Each session now opts into OMP's structured ask dialog. An ask posts its
questions, options and recommendation to the room, mentioning the requester;
the post is the turn's reply. Every question is answered at once with an
acknowledgement, and the participant's reply resumes the same native session
as the next message. A failed post is reported to the model instead; a room
the platform stopped still ends the turn.

The RPC client also stops admitting host-tool and UI callbacks once shutdown
begins, since cleanup can no longer cancel them and they could still post.
@bandzalkin bandzalkin changed the title feat(omp): route the native ask tool to the room fix: post OMP ask questions to the room instead of aborting the turn Oct 15, 2026

This branch has not been deployed

No deployments
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