Skip to content

🤖 fix: stabilize local concurrency warning with agent counts - #4194

Merged
ammario merged 15 commits into
mainfrom
fix-stable-local-agent-warning
Sep 9, 2026
Merged

ammario merged 15 commits into
mainfrom
fix-stable-local-agent-warning

Conversation

@ammar-agent

Copy link
Copy Markdown
Collaborator

Stack

Third PR, stacked on #4173 (fix-chat-loading-gap), which is stacked on #4172. Merge bottom-up; this diff contains only the concurrency-warning change.

Summary

Replace changing agent names with a stable compact count: “N other local agents running — may interfere.” Agent activity handoffs previously switched the selected name and caused random-looking flashes. Names no longer participate in warning rendering.

Implementation

  • Subscribe to the active count instead of the first active workspace identity.
  • Preserve existing brief handoff protection, same-family suppression, and project/runtime isolation rules. Scope the held count to sorted eligible workspace IDs so reordering is harmless and eligibility changes clear stale warnings.
  • Keep the single-row composer decoration and use tabular numerals for stable count typography. No new timers, effects, animations, or tooltips.
  • Cover multi-agent handoffs and metadata reordering, with desktop and explicitly pinned phone stories.

Validation

  • All 47 warning/Storybook contract tests pass, including 10 warning handoff/filtering cases.
  • Three Chromium Storybook renders pass: single-agent desktop, multiple-agent desktop, and fixed-390px phone. Phone checks cover overflow, tabular numerals, and composer clearance.
  • make static-check passes on the integrated three-PR stack.

Subtractive ledger

P1: 27 production lines added, 33 removed; net −6. Removed selected-agent/name resolution and simplified the ChatPane interface. The existing eligibility and handoff safeguards remain. Tests/stories are excluded; no unrelated offsets.

Risks

The warning now reports quantity rather than identity, including for one other agent. Counts change only with activity/eligibility, not with whichever agent happens to appear first.


Generated with xum • Model: openai:gpt-6-astra • Thinking: xhigh • Cost: $436.55

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-09T18:22:44.954094Z 99977af Manual request
🔒 Security Review Completed 2026-09-09T18:23:19.555698Z 99977af Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

This comment has been minimized.

1 similar comment
@chatgpt-codex-connector

This comment has been minimized.

@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Please retry the current published head. Prior attempts failed in the review service with a missing-ref checkout error; no code changes were made since those attempts. Please complete both code and security review.

@chatgpt-codex-connector

This comment has been minimized.

1 similar comment
@chatgpt-codex-connector

This comment has been minimized.

Make child recovery task-owned, honor existing scoped Stop markers before restart work, and preserve explicit compaction continuations. Remove duplicate startup request precedence and tail classification.

---

_Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `xhigh` • Cost: `$117.04`_

<!-- mux-attribution: model=openai:gpt-6-astra thinking=xhigh costs=117.04 -->
Preserve retry opt-outs and pending questions, recognize accepted synthetic guidance after Stop, and contain each pending compaction failure. Strict partial reads distinguish unreadable state from absence without changing existing lenient callers.

---

_Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `xhigh` • Cost: `$152.14`_

<!-- mux-attribution: model=openai:gpt-6-astra thinking=xhigh costs=152.14 -->
---

_Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `xhigh` • Cost: `$222.71`_

<!-- mux-attribution: model=openai:gpt-6-astra thinking=xhigh costs=222.71 -->
…idance

---

_Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `xhigh` • Cost: `$232.99`_

<!-- mux-attribution: model=openai:gpt-6-astra thinking=xhigh costs=232.99 -->
…dates

_Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `xhigh` • Cost: `$236.73`_

<!-- mux-attribution: model=openai:gpt-6-astra thinking=xhigh costs=236.73 -->
_Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `xhigh` • Cost: `$264.85`_

<!-- mux-attribution: model=openai:gpt-6-astra thinking=xhigh costs=264.85 -->
<!-- mux-attribution: model=openai:gpt-6-astra thinking=xhigh costs=264.85 -->
Reuse bulk metadata for identity admission and interrupted retry derivation, retaining the snapshot across deferred reruns.

---

_Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `xhigh` • Cost: `$316.14`_

<!-- mux-attribution: model=openai:gpt-6-astra thinking=xhigh costs=316.14 -->
Restore durable parent guidance behind restarted interactive questions without dispatching a turn. Reuse per-ID queue dedupe and settlement; preserve Stop and opt-out precedence.

Validation: 1083 targeted regression tests; make static-check.
Production ledger: +98/-101, net -3.
Share live/restored guidance background handoff and cancellation settlement. Reuse transient ownership for startup admission, recovery, and empty compaction checks; detach abandoned probes before deferred physical cleanup while preserving adopted sessions.

Validation: 1093 tests passed across five lifecycle suites; make static-check passed.
Production ledger: +83/-83, net zero.
Distinguish durable Stop/opt-out from indeterminate startup blockers and settle stopped child lifecycles before queued work is admitted. Preserve question waits, read-failure blockers, and live work. Suppress redundant nested handle drains until the complete task-stop batch settles.

Simplify stale-starting recovery and reuse the initial queue drain; avoid creating sessions just to clear absent queues.

Validation: 1228 tests passed across six lifecycle suites; make static-check passed.
Production ledger: +52/-50 (net +2); the lower PR remains neutral against its prior -2 ledger.
Fail closed on preference I/O errors, retry boundedly, and discard rejected load caches without losing owed Stop markers or unknown opt-out state. Cancel only captured durable guidance IDs during stop settlement and contain each startup normalization failure independently.

Consolidate preference defaulting and replace manual startup-tail scanning with findLast using identical predicates.

Validation: 1810 tests passed across 38 lifecycle/session files, including tail/goal/compaction; make static-check passed.
Production ledger: +72/-72, net zero.
Reuse initial shimmer and cached transcript rendering without a spinner lane or permanent padding. Validate stable catch-up geometry and a viewport-fitting initial phone skeleton.

---

_Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `xhigh` • Cost: `$152.14`_

<!-- mux-attribution: model=openai:gpt-6-astra thinking=xhigh costs=152.14 -->
Overlay the existing dock edge with accessible shimmer feedback during cached replay, preserving transcript clearance and active-barrier priority. Replace source-syntax viewport assertions with composed metadata and measured phone layout checks.

---

_Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `xhigh` • Cost: `$21.52`_

<!-- mux-attribution: model=openai:gpt-6-astra thinking=xhigh costs=21.52 -->
Show a compact tabular count instead of cycling the first active agent name. Preserve family and isolation exclusions, scoped stale-warning clearing, and existing handoff hysteresis. Cover multi-agent handoffs, metadata reordering, and desktop/phone geometry.

---

_Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `xhigh` • Cost: `$33.18`_

<!-- mux-attribution: model=openai:gpt-6-astra thinking=xhigh costs=33.18 -->
ammar-agent added a commit that referenced this pull request Sep 9, 2026
## Summary

Record the user preference to use `gh stack` for GitHub-native stacked PRs, keeping every PR linked in the native stack rather than only chaining base branches. `AGENTS.md` points to `docs/AGENTS.md`; the generated built-in skill copy is synchronized.

## Stack

Fourth PR in native stack #4174, directly above #4194: #4172#4173#4194 → this PR. Stack membership is managed with `gh stack link`.

## Validation

- Formatting checked against the resolved `AGENTS.md` target.
- `make static-check` and `git diff --check`.
- No prose-only assertion tests added.

## Subtractive ledger

Production logic: +0 / −0. One documentation line and its generated string mirror; no behavior changes or unrelated subtractions.

---

_Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `xhigh` • Cost: `$459.97`_

<!-- mux-attribution: model=openai:gpt-6-astra thinking=xhigh costs=459.97 -->
@ammar-agent
ammar-agent force-pushed the fix-stable-local-agent-warning branch from c21c9e0 to 99977af Compare September 9, 2026 17:49
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Rebased onto fresh main b03d253 with gh stack; current head is 99977af. The four-PR native stack is preserved. Local static checks and 2,476 backend/UI regression tests passed on the full rebased stack. Please review this new head, including code and security checks.

@chatgpt-codex-connector

This comment has been minimized.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 99977af0c6

ℹ️ 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".

@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex security review

Code review approved current head 99977af. Please retry security review only; its last attempt failed in checkout before examining the same published head.

@chatgpt-codex-connector

This comment has been minimized.

1 similar comment
@chatgpt-codex-connector

This comment has been minimized.

@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Retrying the unchanged rebased head after the checkout-service failures. Successful reviews on this stack confirm the published refs are available; please complete code and security review. No source changes or gate bypasses have been made.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 99977af0c6

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 99977af0c6

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ammar-agent

Copy link
Copy Markdown
Collaborator Author

Both code and security reviews now successfully approve 99977af with no findings. The seven earlier missing-ref checkout errors are superseded and are being marked outdated. No substantive review finding is being hidden; existing approvals and security reports remain visible.

Base automatically changed from fix-chat-loading-gap to main September 9, 2026 20:45
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

The blocking checks were real: Required and Codex Comments in independent run 34385271008 were hidden by gh pr checks name deduplication behind another successful run. The in-tree readiness fix in #4196 now detects them through GitHub’s complete rollup. Retrying this exact failed run after verifying its underlying review comments are resolved; no merge-queue bypass is involved.

ammar-agent added a commit that referenced this pull request Sep 9, 2026
## Summary

Make PR readiness use GitHub's complete check rollup instead of the name-deduplicated `gh pr checks` projection, and record the preference for `gh stack` to manage native stacked PRs.

## Background

On #4194, successful `Required` and `Codex Comments` checks from one workflow run hid two still-failing checks with the same names in another run. The previous readiness workflow incorrectly reported success. The new discovery path was tested against that live failure and returns exit 1 with both failing job URLs.

## Implementation

- Share paginated, commit-pinned head/merge check discovery between the readiness waiter and log extractor; retain independent suite results while relying on GitHub's rollup to exclude superseded attempts.
- Fail closed on API errors or incomplete pagination, and keep unknown check states pending.
- Do not infer that a pending Pixel status explains GitHub's `BLOCKED` state. Failure output prioritizes failing checks and identifies their commits.
- Run offline behavioral regressions in CI and update AGENTS.md plus its generated skill copy.

## Stack

Remains directly above #4194 in native stack #4174; #4172 and #4173 have merged.

## Validation

- 19 new PR-check regressions and 12 existing Codex-gate tests passed.
- Shellcheck, `make static-check`, and `git diff --check` passed.
- Live reproduction on #4194 surfaced both hidden failures from run `34385271008`; retrying that exact run subsequently passed.

## Risks

Readiness becomes intentionally stricter: independent failures and unexplained GitHub blockers can no longer be masked by same-name successes or optional Pixel statuses.

## Production ledger

Workflow scripts/config: +100 / −49 (net +51), excluding tests and documentation. Removed repeated state predicates, duplicated discovery, and the unsafe Pixel/BLOCKED shortcut; added complete paginated discovery and validation.

---

_Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `xhigh` • Cost: `$591.32`_

<!-- mux-attribution: model=openai:gpt-6-astra thinking=xhigh costs=591.32 -->
@ammario
ammario merged commit 41fecba into main Sep 9, 2026
84 of 110 checks passed
@ammario
ammario deleted the fix-stable-local-agent-warning branch September 9, 2026 21:12
ammar-agent added a commit that referenced this pull request Sep 9, 2026
## Summary

Make PR readiness use GitHub's complete check rollup instead of the name-deduplicated `gh pr checks` projection, and record the preference for `gh stack` to manage native stacked PRs.

## Background

On #4194, successful `Required` and `Codex Comments` checks from one workflow run hid two still-failing checks with the same names in another run. The previous readiness workflow incorrectly reported success. The new discovery path was tested against that live failure and returns exit 1 with both failing job URLs.

## Implementation

- Share paginated, commit-pinned head/merge check discovery between the readiness waiter and log extractor; retain independent suite results while relying on GitHub's rollup to exclude superseded attempts.
- Fail closed on API errors or incomplete pagination, and keep unknown check states pending. Revalidate PR refs and merge/review state before accepting collected checks; a concurrent push or base update returns pending.
- Do not infer that a pending Pixel status explains GitHub's `BLOCKED` state. Failure output prioritizes failing checks and identifies their commits.
- Run offline behavioral regressions in CI and update AGENTS.md plus its generated skill copy.

## Stack

Remains directly above #4194 in native stack #4174; #4172 and #4173 have merged.

## Validation

- 22 new PR-check regressions and 12 existing Codex-gate tests passed.
- Shellcheck, `make static-check`, and `git diff --check` passed.
- Live reproduction on #4194 surfaced both hidden failures from run `34385271008`; retrying that exact run subsequently passed.

## Risks

Readiness becomes intentionally stricter: independent failures and unexplained GitHub blockers can no longer be masked by same-name successes or optional Pixel statuses.

## Production ledger

Workflow scripts/config: +125 / −51 (net +74), excluding tests and documentation. Removed repeated state predicates, duplicated discovery, and the unsafe Pixel/BLOCKED shortcut; added complete paginated discovery and validation.

---

_Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `xhigh` • Cost: `$591.32`_

<!-- mux-attribution: model=openai:gpt-6-astra thinking=xhigh costs=591.32 -->
ammar-agent added a commit that referenced this pull request Sep 9, 2026
## Summary

Record the user preference to use `gh stack` for GitHub-native stacked PRs, keeping every PR linked in the native stack rather than only chaining base branches. `AGENTS.md` points to `docs/AGENTS.md`; the generated built-in skill copy is synchronized.

## Stack

Fourth PR in native stack #4174, directly above #4194: #4172#4173#4194 → this PR. Stack membership is managed with `gh stack link`.

## Validation

- Formatting checked against the resolved `AGENTS.md` target.
- `make static-check` and `git diff --check`.
- No prose-only assertion tests added.

## Subtractive ledger

Production logic: +0 / −0. One documentation line and its generated string mirror; no behavior changes or unrelated subtractions.

---

_Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `xhigh` • Cost: `$459.97`_

<!-- mux-attribution: model=openai:gpt-6-astra thinking=xhigh costs=459.97 -->
ammar-agent added a commit that referenced this pull request Sep 9, 2026
## Summary

Make PR readiness use GitHub's complete check rollup instead of the name-deduplicated `gh pr checks` projection, and record the preference for `gh stack` to manage native stacked PRs.

## Background

On #4194, successful `Required` and `Codex Comments` checks from one workflow run hid two still-failing checks with the same names in another run. The previous readiness workflow incorrectly reported success. The new discovery path was tested against that live failure and returns exit 1 with both failing job URLs.

## Implementation

- Share paginated, commit-pinned head/merge check discovery between the readiness waiter and log extractor; retain independent suite results while relying on GitHub's rollup to exclude superseded attempts.
- Fail closed on API errors or incomplete pagination, and keep unknown check states pending.
- Do not infer that a pending Pixel status explains GitHub's `BLOCKED` state. Failure output prioritizes failing checks and identifies their commits.
- Run offline behavioral regressions in CI and update AGENTS.md plus its generated skill copy.

## Stack

Remains directly above #4194 in native stack #4174; #4172 and #4173 have merged.

## Validation

- 19 new PR-check regressions and 12 existing Codex-gate tests passed.
- Shellcheck, `make static-check`, and `git diff --check` passed.
- Live reproduction on #4194 surfaced both hidden failures from run `34385271008`; retrying that exact run subsequently passed.

## Risks

Readiness becomes intentionally stricter: independent failures and unexplained GitHub blockers can no longer be masked by same-name successes or optional Pixel statuses.

## Production ledger

Workflow scripts/config: +100 / −49 (net +51), excluding tests and documentation. Removed repeated state predicates, duplicated discovery, and the unsafe Pixel/BLOCKED shortcut; added complete paginated discovery and validation.

---

_Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `xhigh` • Cost: `$591.32`_

<!-- mux-attribution: model=openai:gpt-6-astra thinking=xhigh costs=591.32 -->
ammar-agent added a commit that referenced this pull request Sep 9, 2026
## Summary

Make PR readiness use GitHub's complete check rollup instead of the name-deduplicated `gh pr checks` projection, and record the preference for `gh stack` to manage native stacked PRs.

## Background

On #4194, successful `Required` and `Codex Comments` checks from one workflow run hid two still-failing checks with the same names in another run. The previous readiness workflow incorrectly reported success. The new discovery path was tested against that live failure and returns exit 1 with both failing job URLs.

## Implementation

- Share paginated, commit-pinned head/merge check discovery between the readiness waiter and log extractor; retain independent suite results while relying on GitHub's rollup to exclude superseded attempts.
- Fail closed on API errors or incomplete pagination, and keep unknown check states pending. Revalidate PR refs and merge/review state before accepting collected checks; a concurrent push or base update returns pending.
- Do not infer that a pending Pixel status explains GitHub's `BLOCKED` state. Failure output prioritizes failing checks and identifies their commits.
- Run offline behavioral regressions in CI and update AGENTS.md plus its generated skill copy.

## Stack

Remains directly above #4194 in native stack #4174; #4172 and #4173 have merged.

## Validation

- 22 new PR-check regressions and 12 existing Codex-gate tests passed.
- Shellcheck, `make static-check`, and `git diff --check` passed.
- Live reproduction on #4194 surfaced both hidden failures from run `34385271008`; retrying that exact run subsequently passed.

## Risks

Readiness becomes intentionally stricter: independent failures and unexplained GitHub blockers can no longer be masked by same-name successes or optional Pixel statuses.

## Production ledger

Workflow scripts/config: +125 / −51 (net +74), excluding tests and documentation. Removed repeated state predicates, duplicated discovery, and the unsafe Pixel/BLOCKED shortcut; added complete paginated discovery and validation.

---

_Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `xhigh` • Cost: `$591.32`_

<!-- mux-attribution: model=openai:gpt-6-astra thinking=xhigh costs=591.32 -->
ammario pushed a commit that referenced this pull request Sep 10, 2026
…4196)

## Summary

Make PR readiness use GitHub's complete check rollup instead of the
name-deduplicated `gh pr checks` projection, and record the preference
for `gh stack` to manage native stacked PRs.

## Background

On #4194, successful `Required` and `Codex Comments` checks from one
workflow run hid two still-failing checks with the same names in another
run. The previous readiness workflow incorrectly reported success. The
new discovery path was tested against that live failure and returns exit
1 with both failing job URLs.

## Implementation

- Share paginated, commit-pinned head/merge check discovery between the
readiness waiter and log extractor; retain independent suite results
while relying on GitHub's rollup to exclude superseded attempts.
- Fail closed on API errors or incomplete pagination, and keep unknown
check states pending. Revalidate PR refs and merge/review state before
accepting collected checks; a concurrent push or base update returns
pending.
- Do not infer that a pending Pixel status explains GitHub's `BLOCKED`
state. Failure output prioritizes failing checks and identifies their
commits.
- Run offline behavioral regressions in CI and update AGENTS.md plus its
generated skill copy.

## Stack

Only remaining open PR in native stack #4174, now based on main after
#4172, #4173, and #4194 merged.

## Validation

- 22 new PR-check regressions and 12 existing Codex-gate tests passed.
- Shellcheck, `make static-check`, and `git diff --check` passed.
- Live reproduction on #4194 surfaced both hidden failures from run
`34385271008`; retrying that exact run subsequently passed.

## Risks

Readiness becomes intentionally stricter: independent failures and
unexplained GitHub blockers can no longer be masked by same-name
successes or optional Pixel statuses.

## Production ledger

Workflow scripts/config: +125 / −51 (net +74), excluding tests and
documentation. Removed repeated state predicates, duplicated discovery,
and the unsafe Pixel/BLOCKED shortcut; added complete paginated
discovery and validation.

---

_Generated with `xum` • Model: `openai:gpt-6-astra` • Thinking: `xhigh`
• Cost: `$591.32`_

<!-- mux-attribution: model=openai:gpt-6-astra thinking=xhigh
costs=591.32 -->
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