Files
Fernando XavierandGitHub e438c89fbc fix: resolve two bugs making interactive mode unusable with plugin ecosystems (#825) (#830)
* fix(ink): import logForDebugging in App.tsx to prevent ReferenceError

App.tsx used `logForDebugging()` in four call sites (XTVERSION async
handlers, handleReadable/handleDataChunk stdin error-recovery branches)
without importing it. When esbuild bundled this, the unresolved symbol
collided with another identifier in scope; the bundler renamed most
references to `logForDebugging2` but left the four in App.tsx pointing
at the original name, which became undefined in the bundle. At runtime
any modern terminal replying to the XTVERSION probe triggers an
`unhandledRejection: logForDebugging is not defined`.

Adding the missing import resolves the symbol before bundling, so
the bundler emits a single consistent name for every call site.

Refs #825

* fix(hooks): always close stdin after initial hook payload

The conditional `if (!requestPrompt) child.stdin.end()` kept stdin
open in interactive mode (where requestPrompt is always truthy while
the REPL is mounted). Every plugin hook written against the Anthropic
hook input contract reads stdin until EOF, so hooks blocked on the
per-hook timeout (default 60s) on every user message — no HTTP request
to the provider was made until every UserPromptSubmit hook had timed
out. With ~10 plugins hooked to UserPromptSubmit (pipeline-orchestrator,
superpowers, skill-advisor, episodic-memory, reflexion, etc.), a single
prompt accumulated minutes of wait before any model call.

Always closing stdin after the initial JSON payload restores the
documented EOF-based contract. Verified locally: typical `oi`
turnaround drops from ~60s to ~1s.

Trade-off: the existing duplex-stdin path (hooks emitting prompt
requests on stdout and receiving responses written back to stdin at
hooks.ts:1237) is incompatible with an EOF contract by design and
stops working with this change. Restoring that feature requires a
separate IPC channel (named pipe, node IPC, or a second stream)
rather than reusing the initial stdin; that refactor is out of scope
for this fix. Given the blast radius of the current behaviour (every
user with a plugin ecosystem sees unusable interactive mode), trading
the rarely-used duplex path for the documented single-shot contract
is the right short-term move.

Closes #825
2026-05-07 23:49:31 +08:00
..
2026-03-31 03:34:03 -07:00
2026-03-31 03:34:03 -07:00
2026-03-31 03:34:03 -07:00
2026-03-31 03:34:03 -07:00
2026-03-31 03:34:03 -07:00
2026-03-31 03:34:03 -07:00
2026-03-31 03:34:03 -07:00
2026-03-31 03:34:03 -07:00
2026-03-31 03:34:03 -07:00
2026-03-31 03:34:03 -07:00
2026-03-31 03:34:03 -07:00
2026-03-31 03:34:03 -07:00
2026-03-31 03:34:03 -07:00
2026-03-31 03:34:03 -07:00
2026-03-31 03:34:03 -07:00
2026-03-31 03:34:03 -07:00
2026-03-31 03:34:03 -07:00
2026-03-31 03:34:03 -07:00
2026-03-31 03:34:03 -07:00
2026-03-31 03:34:03 -07:00
2026-03-31 03:34:03 -07:00
2026-03-31 03:34:03 -07:00
2026-03-31 03:34:03 -07:00
2026-03-31 03:34:03 -07:00
2026-03-31 03:34:03 -07:00
2026-03-31 03:34:03 -07:00
2026-03-31 03:34:03 -07:00
2026-03-31 03:34:03 -07:00
2026-03-31 03:34:03 -07:00
2026-03-31 03:34:03 -07:00
2026-03-31 03:34:03 -07:00
2026-03-31 03:34:03 -07:00
2026-03-31 03:34:03 -07:00
2026-03-31 03:34:03 -07:00
2026-03-31 03:34:03 -07:00
2026-03-31 03:34:03 -07:00