Skip to content

🤖 fix: avoid local-agent warning flashes for sub-agents - #4169

Merged
ammario merged 3 commits into
mainfrom
fix-local-agent-warning-flash
Sep 8, 2026
Merged

ammario merged 3 commits into
mainfrom
fix-local-agent-warning-flash

Conversation

@ammar-agent

@ammar-agent ammar-agent commented Sep 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Prevent the local-agent interference warning from flashing for coordinated sub-agents, while retaining it for unrelated local task families sharing the project directory. Follow-up UX fix after #4153.

Implementation

  • Derive frontend-only family roots during the existing bulk metadata load, before archived rows are filtered. Cycle members and incoming descendants share a deterministic representative; no extra IPC, disk reads, or persisted state.
  • Compare those roots in the UI, excluding coordinated ancestors, descendants, siblings, and cousins while still warning about unrelated families' active sub-agents.
  • Retain workspace identity rather than a display name during activity handoffs, and resolve it against current candidates so navigation into that agent's family cannot leave a stale warning.
  • Replace manual memoized ID collection and repeated metadata lookup with filtered metadata and a direct active-workspace selection; inline the single-use warning view. No new timer or effect.
  • In a separate CI compatibility commit, recognize Codex's observed automatic security-review heading without exempting actual findings.

Validation

  • Five same-family cases reproduced the false warning before the fix; a separate regression reproduced the held-warning leak when switching into the active agent's child.
  • All 232 focused config/warning/workspace-family tests and 1,021 workspace/task service tests pass. Real-config tests cover archived ancestry, cycle members/incoming descendants in both input orders, unrelated trees, and non-persistence of derived roots.
  • Codex gate tests reproduce the new-heading false positive and verify that explicit or appended security findings remain blocking.
  • Headless Storybook-manager checks passed at 1140px and the existing pinned 375px phone viewport: one-line warning, ellipsis on phone, no horizontal overflow or composer displacement.
  • Local make static-check passes.

Subtractive ledger

P1: 61 production lines added, 62 removed; net −1. The warning fix is +59/−61 (net −2); the separate CI-format compatibility fix is +2/−1 (net +1). Removed frontend ancestry traversal, manual ID-list memoization, redundant metadata lookup/fallback, stale display-name retention, and a single-use view wrapper. Complete family scope is derived during the existing bulk metadata read, not synchronized through new state.

Risks

This changes warning eligibility and adds an optional derived frontend metadata field, not task execution, isolation, or persisted config. Unrelated task trees still warn; existing activity smoothing and unregistered-workspace protection remain intact.


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

Derive warning scope from parent-chain roots and resolve held warning identities against current candidates, avoiding sub-agent and navigation flashes without new timing state.

---

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

<!-- mux-attribution: model=openai:gpt-6-astra thinking=xhigh costs=31.97 -->
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 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-08T23:20:37.182333Z 6450ffc Manual request
🔒 Security Review ✅ Completed 2026-09-08T23:21:24.342484Z 6450ffc 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.

@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: c9c6c57293

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.

@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: c9c6c57293

ℹ️ 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 thread src/browser/components/ConcurrentLocalWarning/ConcurrentLocalWarning.tsx Outdated
Comment thread src/browser/components/ConcurrentLocalWarning/ConcurrentLocalWarning.tsx Outdated
Compute frontend-only family roots from complete bulk metadata, including archived intermediates and deterministic cycle representatives. Remove frontend ancestry traversal and the single-use warning view wrapper.

---

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

<!-- mux-attribution: model=openai:gpt-6-astra thinking=xhigh costs=63.33 -->
Strip only the observed heading before applying existing no-findings checks. Regression coverage keeps appended and explicit security findings blocking.

---

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

<!-- mux-attribution: model=openai:gpt-6-astra thinking=xhigh costs=63.33 -->
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

Addressed both findings:

  • 3963031003 / PRRT_kwDOPxxmWM6gcONi: cycle members and incoming descendants now resolve to the same deterministic cycle representative. Real-config regression runs both metadata orders.
  • 3963031007 / PRRT_kwDOPxxmWM6gcONm: family roots are derived from complete backend metadata before archive filtering, so archived intermediates no longer split a family. Removed frontend ancestry traversal instead of adding archived-fetch state.

All 232 focused tests, 1,021 service tests, Codex gate tests, and static checks pass. Desktop/phone geometry was revalidated after simplifying the warning view.

@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 6450ffc95d

ℹ️ 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: 6450ffc95d

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.

@ammario
ammario merged commit 9f4144f into main Sep 8, 2026
36 of 39 checks passed
@ammario
ammario deleted the fix-local-agent-warning-flash branch September 8, 2026 23:53
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