Skip to content

fix(ios): refuse simulator notification permission changes - #5112

Merged
thymikee merged 2 commits into
callstack:mainfrom
shahjahanpak:fix/5074-ios-notification-permission
Nov 26, 2026
Merged

thymikee merged 2 commits into
callstack:mainfrom
shahjahanpak:fix/5074-ios-notification-permission

Conversation

@shahjahanpak

@shahjahanpak shahjahanpak commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #5074. The iOS simulator settings plan now refuses explicit notifications requests for grant, deny, and reset before resolving the app or calling simctl privacy. It returns ios-notification-permission-unsupported and points callers to alert accept or alert dismiss. The CLI help and permission docs describe the same behavior.

Before / after

Observed in the simulator settings test with a recording runner:

$ agent-device settings permission grant notifications --app com.example.app
base: sends simctl privacy SIM-1 grant notifications com.example.app
head: UNSUPPORTED_OPERATION (ios-notification-permission-unsupported)
      Use `alert accept` or `alert dismiss` to answer the notification prompt.
      Simulator runner calls: 0

Validation

  • Base 24f8181c3 with the regression patch: 3 failed, 25 passed. Head: all 28 simulator settings tests passed. All 4 focused Limrun settings scenarios passed.
  • Lint, typecheck, build, formatting, layering, Fallow, and command docs, docs links, and docs prose checks passed.
  • The affected run stopped in provider tests. The Limrun expectation was updated and passes in the focused run. The Apple runner transport test timed out at 5000 ms on both base and the patched checkout. Full unit and provider checks and live simulator verification remain pending.

Implemented with Codex; checked with Claude Code.


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

View guided diff

Co-authored-by: GPT-6.2 Sol (Codex) <codex@openai.com>

@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 7 files

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

View guided diff | Re-trigger cubic

Comment thread website/docs/docs/run-maestro-flows.md Resolved
@thymikee

Copy link
Copy Markdown
Member

Thanks for the fix. At 5a045c4, two changes are needed because the required Coverage check fails.

The Permissions text changed in run-maestro-flows.md, but not in its source, MAESTRO_COMPAT_LIMITATIONS. agent-device help maestro still says that simctl privacy decides which service a runtime can change, and that current runtimes refuse a targeted notifications change. Now the command refuses before simctl is asked, so users get help that contradicts the docs and the code, while the issue requires both to say the same. This fails "Maestro flow docs stay in sync with versioned compatibility help" in args-maestro-support-matrix.test.ts. The sentence in MAESTRO_COMPAT_LIMITATIONS must equal the doc sentence with backticks removed, and its notification advice must be usable from the Maestro page.

The test "setIosSetting permission runs the simctl plan on the simulator udid and surfaces its refusal" in app-settings.test.ts still uses the notifications target and expects the runtime refusal and a simctl privacy revoke notifications call. The new guard throws first, so this test now fails. A test of the simctl plan and its refusal must use a target that still reaches simctl: switch the fake argv, target, message pattern and expected last call to camera, as in simctl-settings.test.ts.

Two high-priority inline threads still apply: alert command wording, best fixed with the sentence above, and missing dispatch disclosure.

In CI, Coverage reports 2 failed and 22510 passed tests, and both failures come from this change.

A live iOS simulator run at the fixed head is required before merge. Run settings permission grant notifications --app <bundle> --platform ios --json and show UNSUPPORTED_OPERATION, details.reason equal to ios-notification-permission-unsupported, and the hint. Then trigger the notification prompt of that app and show alert accept or alert dismiss answering it.

Not verified here: tests were not run locally, as the results come from the CI log and code reading. No live simulator or Limrun run was done, so the claim that alert accept or alert dismiss answers the prompt rests on the issue statement and known alert behavior. Older or non-iOS simulator runtimes were not checked for simctl privacy notifications support. Tapping the system prompt from a Maestro flow was not checked. Coverage stopped at the failing tests, so its later steps have not been shown to pass.

Before merge, fix the two failures so Coverage passes, then add the live simulator evidence.

…mark the refusal undispatched

Co-authored-by: GPT-6.2 Sol (Codex) <codex@openai.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@shahjahanpak

Copy link
Copy Markdown
Contributor Author

Thanks for the review. Fixed in b88bae0:

  • MAESTRO_COMPAT_LIMITATIONS now carries the same Permissions sentence as run-maestro-flows.md without backticks, and both say that alert accept and alert dismiss are CLI commands outside the Maestro subset.
  • The setIosSetting simctl-plan test in app-settings.test.ts now uses camera for the fake argv, the target, the message pattern and the expected last call.
  • The refusal now carries details.dispatched: 'no', and the grant, deny and reset tests assert it.

app-settings.test.ts, simctl-settings.test.ts and args-maestro-support-matrix.test.ts pass locally (60 of 60), including the two tests that failed in Coverage at 5a045c4. The full Coverage run is left to CI on this head.

Live run on an iPhone 17 Pro Max simulator, iOS 26.2:

  1. The CLI built from these changes, settings permission grant notifications --app <fixture> --platform ios --json:
{
  "success": false,
  "error": {
    "code": "UNSUPPORTED_OPERATION",
    "hint": "Use `alert accept` or `alert dismiss` to answer the notification prompt.",
    "details": {
      "reason": "ios-notification-permission-unsupported",
      "dispatched": "no"
    }
  }
}
  1. The runner fixture app then raised "“AgentDeviceRunner” Would Like to Send You Notifications". alert get listed Don’t Allow and Allow, alert dismiss returned {"message":"dismissed"}, and the next alert get answered alert not found.

Step 2 ran through agent-device 0.21.41, not this branch. This PR does not change the alert path. I have before and after screenshots of the prompt and can attach them if useful.

@thymikee

Copy link
Copy Markdown
Member

Thanks for the update. At b88bae0, no further code changes are needed.

The Maestro help source and docs now both describe alert as a CLI command that the Maestro subset does not include, and the refusal now reports that nothing was dispatched. This resolves the wording thread, as the docs and support matrix match, and the dispatch thread, as the refusal sets dispatched: no and a test asserts it. Both can be marked resolved.

All non-skipped CI checks pass at b88bae0, including Coverage (which failed at 5a045c4), Integration Tests and Smoke Tests (ios). The required live evidence is satisfied by excerpted output from the author, without the message, deviceId or screenshots, and the alert step ran on the released 0.21.41.

Not verified here: tests were not run locally, as the results come from CI, and no separate device run was done. The dispatched override for a Maestro or batch notifications refusal after an applied entry was traced in code, but was not exercised by a live flow or a dedicated test. It was not observed at runtime that reset all leaves notifications untouched. Provider routes that do not use the simctl plan were outside this update and were not run.

Nothing in this update holds back the merge, so it is ready for the maintainer merge decision.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 26, 2026
@thymikee
thymikee merged commit 9f7751e into callstack:main Nov 26, 2026
15 checks passed
@shahjahanpak
shahjahanpak deleted the fix/5074-ios-notification-permission branch November 26, 2026 15:05
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.

iOS simulator: refuse notifications permission with a hint to alert accept|dismiss

2 participants