Skip to content

docs(agents): stop local simulators and emulators on close - #4166

Merged
thymikee merged 3 commits into
mainfrom
t3/simulator-cleanup-instructions
Nov 2, 2026
Merged

thymikee merged 3 commits into
mainfrom
t3/simulator-cleanup-instructions

Conversation

@thymikee

@thymikee thymikee commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Summary

After an overnight agent run, many local simulators were left running. open boots a stopped simulator or emulator, but plain close never stops it, and no instruction told agents to add --shutdown.

This PR states one interim rule with one exception: if your session booted a local simulator or emulator, use close --shutdown, unless the user asks to keep it running. It appears in:

  • close help and the manual-qa and validate help topics. The workflow card stays unchanged because it is at its 9100-byte budget.
  • Skills: agent-device, dogfood, ios-simulator, android-emulator (one line each). The simulator skill contract test requires the line.
  • docs/agents/device-verification.md (owner for repo workers). I deleted two cleanup lines that repeat CLI help to stay under the docs/agents budget.

9 files. Instructions only. #4162 (0.22) moves the rule into the daemon: plain close stops a device that the session's open booted. This interim text is then deleted.

Validation

Head 6fdb246, rebased on 7b3f63f.

  • pnpm gate agent-guidance: pass (AGENTS.md 3999/4000, docs/agents 39893/40000).
  • pnpm check:affected --run --head 6fdb246a0e (full FAIL-OPEN set): every stage passed except unit. unit had 1 failure, daemon-client-lifecycle.test.ts, and that file passes alone (19/19). The previous round showed different flakes under load (daemon-client-timeout-route, provider-revyl/runtime), and both pass alone. Receipt: .tmp/validation/run-7YyBOZ/receipt.json (local).
  • Help/skill tests: cli-help, cli-help-topics, simulator-skills-contract, help-conformance-bench pass.
  • No device run: only help/skill text changed.

@vercel

vercel Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
agent-device-website Ready Ready Preview Nov 2, 2026 2:28pm UTC

Request Review

@apex-sentinel-staging

apex-sentinel-staging Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Apex Sentinel

Verdict: approve

Since the last review: 0 new · 0 still open · 0 no longer raised

No findings.

Not in the reviewers' prompt (8 files)
  • docs/agents/device-verification.md: no reviewer was selected for this change
  • packages/command-surface/src/management/app.ts: no reviewer was selected for this change
  • scripts/__tests__/simulator-skills-contract.test.ts: no reviewer was selected for this change
  • skills/agent-device/SKILL.md: no reviewer was selected for this change
  • skills/android-emulator/SKILL.md: no reviewer was selected for this change
  • skills/dogfood/SKILL.md: no reviewer was selected for this change
  • skills/ios-simulator/SKILL.md: no reviewer was selected for this change
  • src/commands/schema/cli-help-workflows.ts: no reviewer was selected for this change

Reply under an inline comment with @apex-sentinel-staging note ... or @apex-sentinel-staging pivot ... to re-check that finding.
Comment @apex-sentinel-staging review on this conversation to run a full review.

Earlier reviews

Review of 9f2271ce · time not recorded

Apex Sentinel

Verdict: approve

No findings. round 1 added 0 new fingerprints (<= 2).

Not in the reviewers' prompt (10 files)
  • AGENTS.md: no reviewer was selected for this change
  • docs/agents/device-verification.md: no reviewer was selected for this change
  • packages/command-surface/src/management/app.ts: no reviewer was selected for this change
  • scripts/__tests__/simulator-skills-contract.test.ts: no reviewer was selected for this change
  • skills/agent-device/SKILL.md: no reviewer was selected for this change
  • skills/android-emulator/SKILL.md: no reviewer was selected for this change
  • skills/dogfood/SKILL.md: no reviewer was selected for this change
  • skills/ios-simulator/SKILL.md: no reviewer was selected for this change
  • src/commands/schema/cli-help-workflows.ts: no reviewer was selected for this change
  • src/commands/schema/cli-help.ts: no reviewer was selected for this change

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 5.69 MB 5.69 MB +318 B
Package (unpacked) 5.69 MB 5.69 MB +318 B
Package (download) 1.73 MB 1.73 MB +105 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 32.7 ms 32.6 ms -0.1 ms
CLI --help 68.2 ms 71.6 ms +3.3 ms

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 10 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread AGENTS.md Resolved
Comment thread skills/dogfood/SKILL.md Resolved
Comment thread src/commands/schema/cli-help.ts Resolved
Comment thread docs/agents/device-verification.md Resolved
Comment thread docs/agents/device-verification.md Resolved
Comment thread AGENTS.md Resolved
Comment thread skills/ios-simulator/SKILL.md Resolved
Comment thread skills/agent-device/SKILL.md Resolved
Comment thread docs/agents/device-verification.md Resolved
@thymikee

thymikee commented Nov 2, 2026

Copy link
Copy Markdown
Member Author

I reviewed 9f2271c. The docs change has one problem that stops the merge: the Ownership and context budgets check fails. The added sentence in AGENTS.md takes the file from 3999 to 4071 bytes (limit 4000), and the device-verification.md addition pushes docs/agents to 40346 bytes (limit 40000). That required check is red, so the PR cannot merge. Please remove the AGENTS.md sentence, because device-verification.md already owns this rule and AGENTS.md routes device work there. Then cut the 4-line addition in device-verification.md to 1-2 lines and remove about 350 bytes of duplication elsewhere in docs/agents, as the assertion message says.

That failure is likely related to this PR, since both files are edited here. I did not inspect the Coverage job log, so I cannot say if it relates to this change. Smoke Tests were still running when I reviewed. There are no conflicts.

Not blocking, and you can take or leave these: device-verification.md:34 and the other texts state the same rule with three different exceptions (always for workers, only when the user says so, and unless the device must stay up), so one owner in device-verification.md and the close help with one exception wording would be clearer, and skills could keep the one-line command only; cli-help.ts:81 says to shut down any local simulator or emulator the session touched, while #4162 says to stop only devices that open booted, so please scope it to a device your session booted or that no other session uses; and app.ts:96 edits close metadata that #4162 will rewrite again.

Could this PR be smaller? For example, add 1-2 lines to device-verification.md for repo workers (scoped to a device the worker booted, with --session), leave skills and help alone, and fix the overnight leak in #4162 so plain close stops a boot-owned device. For that, the session record needs to know the device was booted by the session, and close needs to stop it. Then the interim text can be deleted.

I did not read the daemon close/shutdown handler. I took the behavior from #4162, sessions.md and the flag declarations.

The open inline threads on the keep-up exception in AGENTS.md, dogfood skill exception, help versus docs exception, shutdown ownership check, missing --session, physical and provider devices and AGENTS.md scope still stand. Three lower-priority threads also still apply.

Before merge, fix the two budget limits, unify the rule and its exception, and decide whether to wait for #4162.

Agents finish with plain close, which never stops the device, while open
boots a stopped one. Tell them to finish with close --shutdown on local
simulators and emulators, in close help, workflow/manual-qa/validate help,
the skills, and the repo agent docs.

Refs #4162
Address review: one rule and one exception everywhere (the session booted
the local simulator or emulator, unless the user asks to keep it running).
Drop the AGENTS.md sentence; device-verification.md owns the rule. Remove
two cleanup lines that duplicate CLI help and the line above them.
The workflow card was 9092 of 9100 bytes on main. Leave it unchanged; the
close command help and the manual-qa/validate topics carry the rule.
@thymikee
thymikee force-pushed the t3/simulator-cleanup-instructions branch from 9f2271c to 6fdb246 Compare November 2, 2026 14:28
@thymikee

thymikee commented Nov 2, 2026

Copy link
Copy Markdown
Member Author

Addressed the review at 6fdb246 (rebased on main):

  • Budgets: the AGENTS.md sentence is removed (3999/4000). The device-verification.md addition is now one line, and I deleted two cleanup lines that repeat CLI help (docs/agents 39893/40000). pnpm gate agent-guidance passes.
  • One rule, one exception everywhere: "if your session booted a local simulator or emulator, use close --shutdown, unless the user asks to keep it running". This scopes it to boot-owned devices, matching close: stop a simulator or emulator that the session's open booted #4162.
  • Skills keep one line each. The workflow card is unchanged because it was 9092/9100 bytes on main.
  • --session: the new line extends the existing sentence that requires the original session, platform, UDID and state directory.
  • close: stop a simulator or emulator that the session's open booted #4162: not waiting. The interim text is small and its completion conditions already say to delete it. close metadata will be rewritten there.
  • Coverage on 9f2271c: the job log ends at 10:04, partway through an 11-minute run, with no test failure in it. Coverage passes on main. It is re-running on this head.

All 10 inline threads are answered and resolved.

@thymikee

thymikee commented Nov 2, 2026

Copy link
Copy Markdown
Member Author

The changes look good at 6fdb246: the condition now comes first in the shutdown rule, which fixes what the earlier review at 9f2271c raised (#4166 (comment)). Not blocking: the same sentence now appears in 7 places with slight wording drift, and the skill contract test only checks the substring agent-device close --shutdown, so you could keep the full rule in the close help and have the cards point to it, or leave it as is.

The inline thread on device-verification.md:34 (#4166 (comment)) is fixed at this head, since the line now starts with "If your session booted a local simulator or emulator, add --shutdown ...". It is already resolved.

Repo Guards, Coverage and Integration Tests now pass; only Smoke Tests is still running. The diff only touches docs, help strings and a skill contract test, so it does not overlap the Coverage and Integration routes. I did not run pnpm check or the budget gate. I computed the byte counts from git objects, and they pass the budget checks.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 2, 2026
@thymikee
thymikee merged commit 156d69e into main Nov 2, 2026
20 checks passed
@thymikee
thymikee deleted the t3/simulator-cleanup-instructions branch November 2, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant