Skip to content

[Feat] Block environment verification with manage_tasks await#334

Draft
roomote-roomote[bot] wants to merge 4 commits into
developfrom
feature/manage-tasks-await-env-verify-0ztk6rf5bhcfj
Draft

[Feat] Block environment verification with manage_tasks await#334
roomote-roomote[bot] wants to merge 4 commits into
developfrom
feature/manage-tasks-await-env-verify-0ztk6rf5bhcfj

Conversation

@roomote-roomote

@roomote-roomote roomote-roomote Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Opened on behalf of Daniel Riccio. Follow up by mentioning @roomote-roomote, in the web UI, or in Slack.

Related issue

No GitHub issue. Internal reliability work from Slack-owned investigation into post-create environment verification (soft agent poll loops were not reliable).

Why this PR exists

  • A maintainer explicitly invited this PR in the linked issue or discussion
  • I am a maintainer / this is internal Roomote work

Slice A of platform-owned environment verification: ownership of verification must not depend on model-driven get_summary polling while the parent turn can go Idle/Ready mid-boot. Follow-up review fixed misclassification of stopping/failed runs and required message success before readiness claims.

What changed

  • Added Roomote MCP manage_tasks action await: server-side blocks/polls a task summary until it settles (Completed / Failed / Canceled / Ready / Idle / NeedsInput) or times out (default 25m, max 45m).
  • Result is a compact text payload with terminal label, ready yes/no, timed-out flag, waited duration, and error summary so callers keep one mid-turn tool call instead of sleep loops.
  • Settlement prioritizes latest run failed/canceled over aggregate completed, and keeps stopped/shutting_down runs active (not ready).
  • environment-setup now does list_environments → launch verification → await → required get_messages success assertion → bounded env-definition repair (≤2 extra full cycles) → report.

How it was tested

  • vitest for await-task settlement/timeout/classification (+ fail-over-completed and stopped phase cases)
  • vitest for environmentSetupSkill contract strings
  • Worker/package typecheck clean; pre-push lint/types/knip green

Checklist

  • The PR title follows the repo convention: [Fix], [Feat], [Improve], [Refactor], [Docs], or [Chore] followed by a user-facing description
  • This PR is small and scoped to one change
  • pnpm lint and pnpm check-types pass locally
  • I added tests or included a clear manual validation note above
  • I removed secrets, tokens, private keys, and customer data from code, logs, and screenshots
  • If this change should appear in the changelog, I ran pnpm changeset

roomote added 2 commits July 14, 2026 18:34
Block server-side on follow-up task settlement so environment-setup can
own verification with one job call instead of model-driven poll loops.
@roomote-roomote

roomote-roomote Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

No new code issues found. See task

  • apps/worker/src/mcp/roomote-mcp-server/await-task.ts treats running runs in stopped or shutting_down as settled, then the fallback classifies them as Idle and ready. Those phases precede final failure/cancellation, so keep polling or return an explicitly non-ready outcome.
  • apps/worker/src/mcp/roomote-mcp-server/await-task.ts checks aggregate completed before a latest run's explicit failed or canceled status. A failed/canceled resume can leave the task aggregate-completed, causing await to mislabel that run as successful; prioritize the latest terminal run status.
  • packages/cloud-agents/src/server/workflows/skills/standard/environment-setup/SKILL.md permits Completed, Ready, or Idle without an error to verify an environment without requiring the verifier's final message. A run completes whenever the agent turn ends, including when it reports a startup blocker, so require a get_messages success assertion before reporting readiness.

Reviewed 51bbbc4

@roomote-roomote

roomote-roomote Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

Fixed all 3 review findings in 3e5cfd3.

  • Keep running+stopped/shutting_down active (keep polling; no ready settle)
  • Prefer latest run failed/canceled over aggregate completed
  • environment-setup now requires get_messages success assertion after await; no Terminal-only readiness

Commit: 3e5cfd3

roomote and others added 2 commits July 14, 2026 18:45
Do not settle stopped/shutting_down runs as ready, prefer latest run
failed/canceled over completed, and require get_messages before env
setup reports readiness.
A single failed getTaskSummary poll (platform-API stall, rolling restart,
or a launch/enqueue race before the run row exists) previously aborted the
whole await. Absorb transient read failures and keep polling until the task
settles; surface a retryable error only once reads keep failing past a
bounded grace window (2m) or the overall timeout elapses. Also document why
holding one tool call open for minutes is safe in the OpenCode runtime.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

2 participants