Skip to content

fix(device): install --wait waits for the install itself - #242

Merged
riglar merged 1 commit into
feature/agent-devicesfrom
fix/device-install-wait
Oct 20, 2026
Merged

riglar merged 1 commit into
feature/agent-devicesfrom
fix/device-install-wait

Conversation

@riglar

@riglar riglar commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Needs devicecloud-dev/dcd#1748, which adds install to the session block. Without it, the behaviour is as before.

Bug

Found re-testing on dev. dcd device install <id> --app-binary-id … --wait returned straight away when the session was already usable. A session stays ready while a new build installs, and --wait only waited on the state, so it came back before the app was there. A launch right after could find the old build or none.

Fix

  • install --wait now, once the session is usable, polls session.install until the build is no longer installing:
    • installed: exit 0, "Installed com.example".
    • failed: exit 2, with the reason and "Session … is still open". In --json, the reason is in error.
    • A different build (superseded by another install): returns.
    • An API without install: returns at once, as before.
  • start --app … --wait does the same after the device is ready, so a build that can't be installed exits 2 instead of looking like a success.
  • It has the same 20-minute limit and auth renewal as the other waits. A session that ends while waiting exits 4.
  • DeviceSession gains the optional install field.

Tests

Three new tests in device-command.test.ts: waits through installing until installed, exits 2 on failed with the reason, and doesn't hang on an API without the field. pnpm lint, pnpm typecheck, pnpm test:unit and pnpm build pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_018tQfgpTsA9UhcopKoDezUA

install --wait returned as soon as the session was usable, but a session
stays ready while a new build installs, so it came back before the app
was there. It now also polls the session block's install.status (dcd
#1748) until the build is installed or failed. A failed install exits 2
with the reason and says the session is still open; start --app --wait
does the same. An API without install status returns as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tQfgpTsA9UhcopKoDezUA
@claude

claude Bot commented Oct 20, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@riglar
riglar merged commit a1348a2 into feature/agent-devices Oct 20, 2026
3 checks passed
@riglar
riglar deleted the fix/device-install-wait branch October 20, 2026 15:14
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