pi-mono/packages/coding-agent/src/modes
robopipi[bot] c1810bf70f
feat(coding-agent): let inline ctx.ui.custom() components report blocked program status (#11471)
Inline `ctx.ui.custom()` components never report pi as blocked through
OSC 7501 program status. This is on purpose, because the same API hosts
loaders. As a result, a custom dialog that waits for the user (an
approval prompt, the `question.ts` example) shows up as `working`, and
the terminal cannot tell that pi needs input.

The extension dialog stack already stores a blocked status for each
dialog and reports the visible one. This change adds an optional
`blocked` option to `ctx.ui.custom()`:

```ts
ctx.ui.custom(factory, { blocked: { kind: "question", message: "Pick a color" } });
```

The inline branch of `showExtensionCustom()` passes it to
`pushExtensionDialog()`. Components without the option behave as before.
Overlays ignore the option because they are not part of the dialog
stack. `docs/tui.md` documents the option.

Testing:
- Added a test to `test/interactive-mode-extension-dialogs.test.ts`:
  - A custom component that opts in reports `blocked`.
- A plain custom component stacked on top of it clears the blocked
status.
  - Closing the plain component restores the blocked status.
  - Closing the opted-in component clears it.
- The test fails without the change to `interactive-mode.ts` and passes
with it.
- `npm run check`: biome and lint pass, and there are no type errors in
coding-agent. The only errors are existing type errors in
`packages/ai/test` from locally generated model data. They are not
related to this change.

Fixes #11428

Requested by @badlogic

Co-authored-by: triagent <triagent@localhost>
2026-10-27 09:27:28 +01:00
..
interactive feat(coding-agent): let inline ctx.ui.custom() components report blocked program status (#11471) 2026-10-27 09:27:28 +01:00
rpc feat(coding-agent): report prompt disposition in RPC responses 2026-09-25 14:53:11 +02:00
index.ts fix(coding-agent): make JSON streaming output linear (#7394) 2026-08-03 18:33:22 +02:00
json-event.ts fix(coding-agent): expose tool metadata at stream start (#7953) 2026-08-19 12:24:30 +02:00
print-mode.ts fix(coding-agent): warn and exit non-zero in print mode on truncated response 2026-10-12 16:06:42 +02:00