Skip to content

fix(undo-close): a restored agent keeps its derived TLDR identity - #1356

Merged
Juliusolsson05 merged 11 commits into
integration/batch-2026-09-27-pfrom
fix/undo-close-derived-identity
Sep 27, 2026
Merged

Juliusolsson05 merged 11 commits into
integration/batch-2026-09-27-pfrom
fix/undo-close-derived-identity

Conversation

@Juliusolsson05

@Juliusolsson05 Juliusolsson05 commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner

Fixes #1347.

Plan: docs/plans/2026-09-26-undo-close-derived-identity.md (first commit).

Problem

Undo Close respawned a closed agent with tldrIdentity: meta.tldrIdentity, the explicit field only. An agent whose identity is DERIVED has no explicit field: its reporting domains are on, but main created it, or its metadata arrived after it acquired TLDR or Goal. Its identity is its session id (tldrIdentityForSession). Undo Close gave it undefined, so spawn minted a fresh UUID. The restored agent then had a new TLDR/Goal identity, so its TLDR and Goal records were no longer reachable from the restored pane. Reload Agents already used the derived rule. Found by review a of #1342.

What merges

  • Undo Close passes tldrIdentityForSession(closedSessionId, meta), the rule Reload Agents uses.
  • respawn now takes the closed id; both callers (a single pane, a project member) have it.
  • An explicit identity passes through unchanged.

Scope

This PR fixes the TLDR/Goal identity (#1347, narrowed after review). Agent Analytics continuity across the new session id is #1342, which can land before or after this one.

Tests

  • undoCloseFailure.renderer.test.tsx:
    • a closed agent with a reporting domain and no explicit identity respawns with its closed id as tldrIdentity, and an explicit one passes through unchanged; red on main (undefined);
    • a project restore gives each member its own closed id; this case was added after review, and a wrong member id now fails it.
  • Gates: on ff32bce5 (main, including fix(goal-loop): Undo Close hands the restored pane its goal loop #1331, merged), npx tsc -b is clean and the renderer actions suites pass (252 tests).

🤖 Generated with Claude Code

Juliusolsson05 and others added 2 commits September 26, 2026 19:45
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Undo Close passed only the explicit tldrIdentity, so an agent whose identity
was derived (reporting domains on, no explicit field) came back with a fresh
one. It now uses tldrIdentityForSession, the rule Reload Agents uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Juliusolsson05 Juliusolsson05 added type:bug Something works wrong class:C2-identity Identity/ownership across reload, replace, restore, wake sev:P3 Minor labels Sep 27, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Juliusolsson05 and others added 2 commits September 26, 2026 22:46
…bers

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d-identity

# Conflicts:
#	src/renderer/src/workspace/hook/actions/undoClose.ts
…d-identity

# Conflicts:
#	src/renderer/src/workspace/hook/actions/undoClose.ts
@Juliusolsson05

Copy link
Copy Markdown
Owner Author

Review disposition. Round 1: a MERGE-READY; b and c FIX-BEFORE-MERGE. Verification: b MERGE-READY (round 2). c FIX-BEFORE-MERGE in round 2 (a base conflict, plus a project test that needed two derived members), then MERGE-READY in round 3 at ff32bce5.

Fixed

Out of scope (the PR and #1347 are narrowed to the TLDR/Goal identity)

Info (a2): the real-data count shows that the derived state is a transient window, not the steady state. No change needed.

🤖 Generated with Claude Code

Juliusolsson05 and others added 4 commits September 26, 2026 23:49
The hand-resolved main merges (1937b5c, ff32bce) staged the worktree's
stale codex-headless checkout (6334d5ac) over main's d42cc1da, so CI read
fixtures that only exist in the newer package (composer-0157). No change
to this PR's own diff.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Juliusolsson05
Juliusolsson05 changed the base branch from main to integration/batch-2026-09-27-p September 27, 2026 20:35
@Juliusolsson05
Juliusolsson05 merged commit 89259ab into integration/batch-2026-09-27-p Sep 27, 2026
2 checks passed
@Juliusolsson05
Juliusolsson05 deleted the fix/undo-close-derived-identity branch September 27, 2026 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

class:C2-identity Identity/ownership across reload, replace, restore, wake sev:P3 Minor type:bug Something works wrong

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(undo-close): a restored agent loses a derived TLDR identity

1 participant