Skip to content

fix: show devai:install prompt text and stream live progress#138

Merged
markshust merged 1 commit into
developfrom
feature/devai-install-prompt-and-progress
Jun 24, 2026
Merged

fix: show devai:install prompt text and stream live progress#138
markshust merged 1 commit into
developfrom
feature/devai-install-prompt-and-progress

Conversation

@markshust

Copy link
Copy Markdown
Collaborator

Problem

marko devai:install appeared to hang after detecting agents. Two issues:

  1. Invisible promptStdinPrompter::confirm() blocked on fgets() without ever writing the question to the terminal, so the docs-driver confirmation looked like a hang (it was silently waiting for keyboard input).
  2. No progress feedback — after answering, the slow steps (composer require, discovery:cache, indexer:rebuild, docs index build) ran silently until the final summary, again looking hung.

Changes

  • StdinPrompter — writes the question + a [Y/n]/[y/N] hint (reflecting the default) to an injectable output stream before reading stdin.
  • InstallationOrchestrator::install() — accepts an optional ?callable $onProgress and announces each slow step before it runs. Per-agent summary lines now read configured instead of installed.
  • InstallCommand — prints Installing … via composer … before the composer step and wires a live progress callback to the orchestrator.

Note on string formatting

Progress messages use string concatenation rather than "$var…" interpolation. The ellipsis glyph's UTF-8 bytes (0x80-0xFF) are valid PHP identifier characters, so "$agentName…" parses as one undefined variable. {$var} braces fix it, but the project's php-cs-fixer remove_unnecessary_curly_braces rule strips them — concatenation is the only formatter-safe form.

Tests

  • ConfirmationPrompterTest — asserts the question + hint are written, and that the hint reflects the default.
  • InstallationOrchestratorTest — live-progress streaming, optional callback, configured wording.
  • UpdateCommandTest — stub orchestrator signature updated to match.

All devai tests pass (252 passed, 596 assertions); phpcs + php-cs-fixer clean on touched files.

🤖 Generated with Claude Code

The docs-driver confirmation prompt blocked on fgets() without ever
writing the question, so `marko devai:install` appeared to hang. The
prompter now writes the question plus a [Y/n] hint before reading.

Also stream live progress: the orchestrator announces each slow step
(agent config, discovery:cache, indexer:rebuild, docs index build) via
an optional progress callback, and the command prints a notice before
the composer require. Per-agent summary lines now read "configured"
rather than "installed".

Note: progress messages use string concatenation rather than "$var…"
interpolation — the ellipsis glyph's UTF-8 bytes (0x80-0xFF) are valid
PHP identifier characters, so "$agentName…" parses as one undefined
variable. Braces ({$var}) would fix it but the project's php-cs-fixer
strips them, so concatenation is the only formatter-safe form.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@markshust markshust merged commit 99d52b6 into develop Jun 24, 2026
1 check passed
@github-actions github-actions Bot added the bug Something isn't working label Jun 24, 2026
@markshust markshust deleted the feature/devai-install-prompt-and-progress branch June 24, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant