Skip to content

Ignore duplicate agent terminal launches within 3s - #30

Open
kody-w wants to merge 3 commits into
blitzdotdev:masterfrom
kody-w:pr/double-agent-launch
Open

kody-w wants to merge 3 commits into
blitzdotdev:masterfrom
kody-w:pr/double-agent-launch

Conversation

@kody-w

@kody-w kody-w commented Oct 15, 2026

Copy link
Copy Markdown

Problem

The onboarding setup agent could be launched twice in quick succession, which started two agent sessions. In our case the two sessions created two App Store Connect API keys, and one had to be revoked.

Fix

  • TerminalLauncher ignores an identical agent launch request that arrives within 3 seconds of the previous one.
  • A failed launch doesn't count, so a genuine retry after a failure still goes through.
  • TerminalLauncherDuplicateLaunchTests covers the duplicate guard.

Testing

Running in a local build of 1.0.35 since 2026-10-14. Note: on current master the test target doesn't compile because of 4 unrelated files (ASCProjectLifecycle, DashboardSummaryStore, ASCScreenshotsLocaleRegression, ASCVersionSelection tests), so the new test hasn't been run through the full test target here.

🤖 Generated with Claude Code

kody-w and others added 3 commits October 15, 2026 11:49
A double-click on "Setup with AI" during ASC onboarding launched the same
claude session in two Terminal windows, so the asc-team-key-create skill ran
twice and created two API keys. TerminalLauncher.launch runs osascript
synchronously on the main thread with no in-flight guard, so a second click is
queued and replayed right after the first launch returns. Dedupe identical
launch commands within a 3s window measured from the end of the launch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The duplicate-launch guard recorded every launch, including failures, so
retrying within 3s after a failed launch was skipped and reported as
success. Forget the launch when it fails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Covers: a replayed click inside the window is skipped, the same command
is allowed after the window, a failed launch doesn't block a retry, and
a different command is never blocked. Verified the test fails when the
failed-launch reset is removed.

Co-Authored-By: Claude Opus 5.5 <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.

1 participant