Fix direct Agent session titles in completion notifications#309
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
💡 Change Scope
📝 What Does This PR Do?
Directly launched Agent windows now adopt the title of their first durable session as soon as the runtime session binding becomes available.
This also fixes a race for very short first turns: completion notifications wait up to one second for the new session title, return immediately when it is ready, and fall back to the launch title when the deadline expires. Entering Working again, deleting the node, or unmounting cancels a pending notification.
The root cause was that standby notifications captured the launch/model title before the asynchronous session catalog lookup had updated the Workspace node. The notification snapshot never read the later title, and the title lookup could have consumed its early retries before the first prompt was submitted.
🏗️ Large Change Spec (Required if "Large Change" is checked)
1. Context & Business Logic
2. State Ownership & Invariants
3. Verification Plan & Regression Layer
pnpm pre-commitpassed, including 41 related tests, 3 native terminal recovery tests, and the complete Electron E2E suite (263 passed, 47 conditionally skipped).✅ Delivery & Compliance Checklist
pnpm pre-commitis completely green.CLA.md).DEVELOPMENT.mdarchitectural boundaries.No user-facing copy, IPC contract, persistence schema, or architecture contract changed. The E2E test captures the final titled Agent window and notification as a Playwright artifact; no review-only media was committed to the repository.
📸 Screenshots / Visual Evidence
The
direct-agent-session-titlePlaywright attachment captures the Agent node and completion notification using the resolved session title.