Repository navigation
feat(agent): describe agent home layouts and try every transcript candidate - #2657
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Codex candidates are not globally newest-first across live and archived stores, allowing a stale rollout to be selected.
Review effort: Balanced
Findings: 1
What changed in this PR
Adds declarative agent-home layouts and multi-file transcript discovery for reliable attachment across live, archived, nested, and restored sessions.
Changes:
- Introduces home-layout and session-file-candidate capabilities.
- Updates transcript discovery to select the first usable regular file.
- Adds coverage for archived, fallback, and symlinked transcripts.
| File | Description |
|---|---|
docs/architecture/agent-guide.md |
Documents new capabilities. |
cmd/entire/cli/transcript.go |
Implements candidate discovery. |
cmd/entire/cli/transcript_discovery_test.go |
Tests discovery scenarios. |
cmd/entire/cli/attach.go |
Uses candidate-based discovery. |
cmd/entire/cli/agent/session_store.go |
Adds candidate containment API. |
cmd/entire/cli/agent/session_store_test.go |
Tests candidate filtering. |
cmd/entire/cli/agent/pi/pi.go |
Lists Pi session candidates. |
cmd/entire/cli/agent/home_layout.go |
Defines home layouts. |
cmd/entire/cli/agent/home_layout_test.go |
Tests layout resolution. |
cmd/entire/cli/agent/factoryaidroid/factoryaidroid.go |
Declares Droid layout. |
cmd/entire/cli/agent/cursor/cursor.go |
Supports nested and flat layouts. |
cmd/entire/cli/agent/copilotcli/copilotcli.go |
Declares Copilot CLI layout. |
cmd/entire/cli/agent/codex/codex.go |
Adds live and archived candidates. |
cmd/entire/cli/agent/claudecode/claude.go |
Declares Claude Code layout. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…didate Add an optional agent.HomeLayoutProvider capability: built-in agents with a relocatable home report it through SessionHome and list their session stores beneath it in a declarative HomeLayout. Claude Code keeps projects, Codex sessions and archived_sessions, Copilot CLI session-state, Pi sessions, and Droid sessions beneath its .factory directory. Add agent.SessionFileCandidatesProvider for agents that may keep one session in several files: Codex and Pi list every dated copy newest first, and Cursor lists its nested layout before its flat one. SessionStore.SessionFileCandidatesIn resolves them, dropping any outside the store. Attach now takes the first candidate that is a regular file instead of failing on an unusable newest copy, and searches every store of the active home when the session directory lies in one, so archived Codex rollouts are found. Symbolic link handling is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Entire-Checkpoint: 01M45WZBW88VTXXBP2FP92QND1
hiddeco
force-pushed
the
hidde/agent-home-layouts
branch
from
October 6, 2026 20:40
01a5f50 to
da62c75
Compare
Codex archives a rollout by moving it to archived_sessions under its original file name, not into dated subdirectories, so attach missed every archived session: the glob only matched archived_sessions/YYYY/MM/DD. Search each archive flat and then dated, as the live store is. Those rollouts lie beside the session directory, not in it, and SessionStore refuses any such path, so only ResolveSessionFileCandidates lists them. ResolveSessionFile now searches the session directory alone; had it kept its archive fallback, a flat archived rollout would have made `entire resume` skip the session as resolving outside its session directory and then fail. Resume restores the checkpoint into the live store, where `codex resume` looks, and leaves the archive alone. Codex's store names are now spelled once, in its home layout, and the session directory, the candidate archives and the subagent rollout roots derive from it, so discovery's store filter cannot drift from them. A test covers that filter. Document why the fallback transcript search refuses linked directories below a store while discoverTranscript follows them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Entire-Checkpoint: 01M4AVT5MV68GFR7VTYEGPQ9VW
discoverTranscript dropped a SessionHome error silently, so attach searched only the session directory, not the home's other stores such as Codex's archived_sessions, with nothing recording why. Log it at debug level and keep searching the session directory: failing would break attach where it worked before the home layout existed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Entire-Checkpoint: 01M4B08MA09T9PCWT3NYV8A7CF
ResolveSessionFileCandidates took sessionDir's parent as the Codex home without checking that sessionDir is that home's sessions store. A relocated session directory, such as ENTIRE_TEST_CODEX_SESSION_DIR, globbed an unrelated archived_sessions beside it; SessionStore dropped those candidates, but the lookup was still wrong. List archives only when sessionDir is <home>/sessions. The home stays sessionDir's parent rather than CODEX_HOME: candidates belong to the session directory the caller passed, which need not lie in the active home. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Entire-Checkpoint: 01M4B0Q8X40GXQD7GW9Z7JABYM
gtrrz-victor
approved these changes
Oct 7, 2026
This was referenced Oct 8, 2026
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.

https://entire.io/gh/entireio/cli/trails/1481
Splitting #2636 into smaller chunks.
Add an optional agent.HomeLayoutProvider capability: built-in agents with a relocatable home report it through SessionHome and list their session stores beneath it in a declarative HomeLayout. Claude Code keeps projects, Codex sessions and archived_sessions, Copilot CLI session-state, Pi sessions, and Droid sessions beneath its .factory directory.
Add agent.SessionFileCandidatesProvider for agents that may keep one session in several files: Codex and Pi list every dated copy, newest first, with Codex listing live rollouts before archived ones, and Cursor lists its nested layout before its flat one. SessionStore.SessionFileCandidatesIn resolves them, dropping any outside the store.
Attach now takes the first candidate that is a regular file instead of failing on an unusable newest copy, and searches every store of the active home when the session directory lies in one, so archived Codex rollouts are found. Symbolic link handling is unchanged.
Codex archives rollouts directly under
archived_sessions, and attach now finds them.ResolveSessionFilesearches only the session directory, becauseSessionStorerefuses paths outside it. Archived rollouts are therefore listed only as attach candidates, andentire resumerestores into the live store.