Skip to content

[codex] support codex fork across cli hub and web#447

Draft
pppobear wants to merge 6 commits intotiann:mainfrom
pppobear:hapi-feature-codex-fork
Draft

[codex] support codex fork across cli hub and web#447
pppobear wants to merge 6 commits intotiann:mainfrom
pppobear:hapi-feature-codex-fork

Conversation

@pppobear
Copy link
Copy Markdown
Contributor

What changed

  • add Codex fork support across CLI, hub, and web using forkSessionId
  • support remote fork through the app server thread/fork flow
  • add web fork entry points in session list, header, and action menu
  • improve fork success feedback with a more prominent clickable toast that can jump to the new session
  • preserve forked conversation history and forked title metadata
  • prevent later CLI update-metadata events from overwriting the inherited fork title by merging metadata instead of replacing it

Why

Users needed to fork an existing Codex session and continue from the new thread remotely. The original implementation also exposed follow-up issues during validation:

  • forked sessions could lose prior HAPI-stored message history
  • forked sessions could lose custom or derived titles
  • later metadata updates could overwrite the inherited title and fall back to the project name
  • success toast styling was too subtle and could look broken on mobile

Root cause

The title regression was not only in fork creation. The hub inherited title-related metadata during fork, but later update-metadata handling replaced metadata wholesale. That dropped inherited fields such as metadata.name and metadata.summary, causing the UI to fall back to the project name.

Impact

  • Codex sessions can now be forked from the web and through the stack end to end
  • forked sessions open with clearer navigation feedback
  • forked sessions preserve both history and title more reliably
  • metadata updates are safer because inherited title fields are merged instead of discarded

Validation

  • bun test hub/src/sync/sessionMetadata.test.ts hub/src/sync/sessionModel.test.ts
  • bun typecheck

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