Skip to content

Fix direct Agent session titles in completion notifications#309

Merged
DeadWaveWave merged 3 commits into
mainfrom
feat/agent-title-rename
Jul 12, 2026
Merged

Fix direct Agent session titles in completion notifications#309
DeadWaveWave merged 3 commits into
mainfrom
feat/agent-title-rename

Conversation

@DeadWaveWave

Copy link
Copy Markdown
Owner

💡 Change Scope

  • Small Change: Fast feedback, localized UI/logic, low-risk.
  • Large Change: New feature, cross-boundary logic, runtime-risk (persistence, IPC, lifecycle, recovery).

📝 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

  • Direct, unpinned, task-free Agent launches derive their durable display title from the exact bound session.
  • A Standby transition restarts the existing title lookup when the node still has its launch title.
  • Completion notifications wait for title readiness for at most one second; unrelated Agent launches keep their existing immediate behavior.

2. State Ownership & Invariants

  • The Workspace Agent node remains the single owner of the display title; the notification layer only reads it.
  • Each Working-to-Standby transition produces at most one completion notification.
  • In-app and native notifications use the same final title snapshot.
  • A pending notification cannot fire after the Agent returns to Working or its lifecycle ends.

3. Verification Plan & Regression Layer

  • Unit coverage verifies exact session matching, stale binding protection, bounded retries, one-second fallback, early readiness, cancellation, and Standby-triggered lookup restart.
  • Electron E2E simulates a first turn completing about 50 ms after input and verifies the node, persisted state, and completion notification all use the new session title.
  • Full pnpm pre-commit passed, including 41 related tests, 3 native terminal recovery tests, and the complete Electron E2E suite (263 passed, 47 conditionally skipped).

✅ Delivery & Compliance Checklist

  • My code passes the ultimate gatekeeper: pnpm pre-commit is completely green.
  • I have signed the CLA if required (see CLA.md).
  • I have included new tests to lock down the behavior (or explicitly stated why it's untestable).
  • I have strictly adhered to the DEVELOPMENT.md architectural boundaries.
  • I have attached a screenshot or screen recording (if this touches the UI).
  • I have updated the documentation accordingly (if adding a feature or changing a contract).

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-title Playwright attachment captures the Agent node and completion notification using the resolved session title.

@DeadWaveWave DeadWaveWave marked this pull request as ready for review July 12, 2026 10:37
@DeadWaveWave DeadWaveWave merged commit 9bad829 into main Jul 12, 2026
9 checks passed
@DeadWaveWave DeadWaveWave deleted the feat/agent-title-rename branch July 12, 2026 10:37
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