Freshcodex contract foundation: canonicalize fresh-agent pane identity and stabilize full suite#334
Conversation
3c02c46 to
0e67ac4
Compare
There was a problem hiding this comment.
💡 Codex Review
freshell/src/store/tabsSlice.ts
Lines 701 to 702 in 3c02c46
When opening a fresh-agent session tab, this condition still checks for desiredResumeContent.kind === 'agent-chat', so sessionRef is dropped for the new tab. Fallback matching logic (buildTabFallbackLocator) relies on tab.sessionRef for non-Claude sessions when a layout is temporarily unavailable, so this omission can cause duplicate tab creation or missed session matching during early hydration/repair flows.
ℹ️ 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".
| const created = input.resumeSessionId && registration.adapter.resume | ||
| ? await registration.adapter.resume(input) | ||
| : await registration.adapter.create(input) |
There was a problem hiding this comment.
Resume fresh-agent sessions when only sessionRef is present
The create path only calls adapter.resume when resumeSessionId is set, but this commit also makes durable identity primarily sessionRef (and persisted panes strip legacy resumeSessionId). For restored Freshcodex panes that have sessionRef but no resumeSessionId, this branch falls back to adapter.create, starting a brand-new thread instead of reopening the durable one, so users lose continuity after reload/rehydration.
Useful? React with 👍 / 👎.
Summary
Boundary-complete identity stabilization for fresh-agent/freshcodex panes across 20 enforcement boundaries, plus provider-aware create/resume and settings normalization.
Core contracts:
fresh-agentis the canonical production pane kind; legacyagent-chatis normalized at every ingress boundarysessionRef) is the only identity published across devices; runtime handles (sessionId,resumeSessionId,serverInstanceId) are stripped at publication boundariesmodelSelectionand opaque effort strings; Codex panes use runtimemodel/sandboxrestoreErrorsuppresses auto-create; nonportable named aliases produce explicit restore errorssessionRef,modelSelection, and opaque effort through the full WS pipelinesessionRef; Claude returnssessionRefonly from canonical metadataundefinedproperties;agentChat/freshAgentaliases mirror correctlyVerification: