Skip to content

fix(macapp): bind external runs to controls - #1118

Merged
dennisonbertram merged 2 commits into
mainfrom
codex/issue-1007-external-run-controls
Aug 3, 2026
Merged

fix(macapp): bind external runs to controls#1118
dennisonbertram merged 2 commits into
mainfrom
codex/issue-1007-external-run-controls

Conversation

@dennisonbertram

@dennisonbertram dennisonbertram commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Closes #1007

Summary

  • bind scoped conversation-SSE cron/callback runs to the native action target
  • prevent stale/older terminal and interactive events from clearing or retargeting a newer run
  • fence cancelled prior-conversation stream deliveries and expose Scheduled run active status
  • preserve rendered run IDs across Stop, approval, plan, question, and steer controls

Test-first evidence

  • Red: RunSessionExternalControlTests initially failed because RunSession had neither scoped event application nor scheduled-run state.
  • Green: the controls suite drives external A/B SSE, verifies A cannot displace/clear B, and verifies approve/deny/input/steer/cancel target B only.

Verification

  • swift test --package-path macapp --filter RunSessionExternalControlTests (PASS)
  • swift test --package-path macapp (PASS; 252 tests / 46 suites)
  • ./scripts/test-regression.sh (PASS; normal, race, coverage)

Promotion note

This PR has been rebased onto the current callback merge chain and independently reviewed at its current head. The installed-app scheduled-continuation proof remains the separate #1010 convergence gate.

@dennisonbertram
dennisonbertram force-pushed the codex/issue-1007-external-run-controls branch from 3421969 to ee11ede Compare August 3, 2026 21:35
* fix(macapp): fence stale interactive affordances

* style(macapp): format interactive control views

* fix(macapp): fence stale stop and steer actions (#1127)

* fix(macapp): fence stale stop and steer actions

* fix(macapp): bind ToolWalk to submitted run identity (#1129)

* fix(macapp): bind ToolWalk to submitted run identity

* fix(macapp): retain submitted run outcomes (#1131)

* fix(toolwalk): observe displaced submission outcomes (#1138)

* fix(toolwalk): observe displaced submission outcomes

* fix(toolwalk): retain immutable timeout authority (#1139)

* fix(toolwalk): retain immutable timeout authority

* test(toolwalk): prove displaced timeout orchestration

* docs(plan): record timeout authority regression evidence

* docs: correct focused orchestration evidence count

* fix(toolwalk): gate timeout cancellation by deadline ticket (#1146)
@dennisonbertram
dennisonbertram marked this pull request as ready for review August 3, 2026 23:22
@cursor

cursor Bot commented Aug 3, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@dennisonbertram
dennisonbertram merged commit bf99206 into main Aug 3, 2026
5 checks passed
@dennisonbertram
dennisonbertram deleted the codex/issue-1007-external-run-controls branch August 3, 2026 23:22

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4c337d65f9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +487 to +489
if activeRunTimestamps[currentRunID] == nil, !externalRunIDs.contains(currentRunID)
{
false

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Reconsider newer runs after provisional ownership resolves

When local A has received its startRun response but no timestamped SSE frame yet, this branch rejects every lifecycle frame from scheduled B, even when B's timestamps are genuinely newer. B is still added to activeRunIDs, but after A receives its first timestamp it is never reconsidered unless B happens to emit another lifecycle event; if B has already reached an approval/input wait, its controls remain suppressed, and A's later terminal also refuses B as a fallback because B's timestamp predates that terminal. This can leave a live scheduled continuation invisible and unactionable, so B should be reconsidered once A's provisional ownership becomes timestamped.

Useful? React with 👍 / 👎.

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.

[Bug]: Bind cron and callback started run IDs to macOS run controls

1 participant