openai / openai/codex

Expose current-thread archival to active automations

Open
#44,784 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app-server automations bug CLI
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

Summary

Expose a narrowly scoped way for an active Codex automation to archive its own current thread after the turn has completed.

The App Server already supports thread/archive, but that operation is not available through the automation's tool surface. An automation that completes repository cleanup must therefore leave its Codex session active for manual archival in the UI.

Requested behavior

Provide either:

  • an archive_current_thread capability; or
  • access to thread/archive with the current thread ID supplied by the runtime.

The automation should not need to enumerate threads with thread/list merely to identify itself.

Minimal acceptance criteria

  • The capability can target only the calling automation's current thread.
  • Existing refusal behavior for a live internal worker or active turn remains in force.
  • The operation archives the persisted conversation; it does not delete it.
  • Retrying after successful archival is safe and reports an already-archived result.
  • Normal archive state/event propagation keeps the App/UI view consistent.

Non-goals

  • Arbitrary archival of other threads
  • General session-management access
  • Thread deletion
  • Redesigning App Server storage or authorization

Motivation

This removes the final manual UI step from an otherwise automated cleanup lifecycle:

  1. complete the task;
  2. verify and preserve repository state;
  3. clean up the exact worktree and local branch;
  4. archive the exact originating Codex session.

Related

  • #45954 tracks the separate App Server initialization/proxy failure encountered while trying to reach the documented archive RPC. This issue is limited to direct current-thread enablement.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the existing App Server thread/archive operation and the automation tool surface, then compare how thread/list obtains thread identity. Verify the current-thread restriction, live-worker refusal, archive idempotency, persisted-conversation behavior, and normal archive state/event propagation; done means the automation can archive only its own completed thread without UI cleanup.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api, backend-api-design
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.