Skip to content

Add thread/unarchive to restore archived rollouts#9843

Merged
charley-oai merged 2 commits intomainfrom
thread-unarchive
Jan 26, 2026
Merged

Add thread/unarchive to restore archived rollouts#9843
charley-oai merged 2 commits intomainfrom
thread-unarchive

Conversation

@charley-oai
Copy link
Collaborator

@charley-oai charley-oai commented Jan 25, 2026

Summary

  • Adds a new thread/unarchive RPC to move archived thread rollouts back into the active sessions/ tree.

What changed

  • Protocol
    • Adds thread/unarchive request/response types and wiring.
  • Server
    • Implements thread_unarchive in the app server.
    • Validates the archived rollout path and thread ID.
    • Restores the rollout to sessions/YYYY/MM/DD/... based on the rollout filename timestamp.
  • Core
    • Adds find_archived_thread_path_by_id_str helper for archived rollouts.
  • Docs
    • Documents the new RPC and usage example.
  • Tests
    • Adds an end-to-end server test that:
      1. starts a thread,
      2. archives it,
      3. unarchives it,
      4. asserts the file is restored to sessions/.

How to use

{ "method": "thread/unarchive", "id": 24, "params": { "threadId": "<thread-id>" } }

Author Codex Session

codex resume 019bf158-54b6-7960-a696-9d85df7e1bc1 (soon I'll make this kind of session UUID forkable by anyone with the right session_object_storage_url line in their config, but for now just pasting it here for my reference)

@charley-oai charley-oai marked this pull request as draft January 25, 2026 05:13
@charley-oai
Copy link
Collaborator Author

@codex review this

@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. What shall we delve into next?

ℹ️ 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".

@charley-oai charley-oai marked this pull request as ready for review January 25, 2026 05:58
Copy link
Collaborator

@owenlin0 owenlin0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left some small comments, pre-approved

})
}

fn rollout_date_parts(file_name: &OsStr) -> Option<(String, String, String)> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a helper function already in codex-rs/core/src/rollout/* somewhere that we can reuse? a function like this should belong there

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think one already existed so I added this to codex-rs/core/src/rollout/list.rs. Does that seem reasonable?

@charley-oai
Copy link
Collaborator Author

@codex review this

@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. Swish!

ℹ️ 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".

@charley-oai charley-oai merged commit 62266b1 into main Jan 26, 2026
53 of 59 checks passed
@charley-oai charley-oai deleted the thread-unarchive branch January 26, 2026 19:24
@github-actions github-actions bot locked and limited conversation to collaborators Jan 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants