Skip to content

Save the last reported plan in a resumable session - #6137

Closed
markstuart-oai wants to merge 10 commits into
feat/simple-codexfrom
feat/native-checklist
Closed

markstuart-oai wants to merge 10 commits into
feat/simple-codexfrom
feat/native-checklist

Conversation

@markstuart-oai

@markstuart-oai markstuart-oai commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Apps using ResumableSession can display the agent's last reported plan, including unfinished steps, after a run ends or pauses for approval. Reopening the session restores the same plan without a model call.

from agents import Agent, ResumableSession, Runner, update_plan

agent = Agent(name="Planner", tools=[update_plan])
session = await ResumableSession.create(store)
await Runner.run(agent, "Draft a proposal and report progress.", session=session)

plan = session.plan
if plan is not None:
    for step in plan.steps:
        print(step.text, step.status)

With CodexProvider, omit the Python tool and set config_overrides=["tools.update_plan.enabled=true"] on the provider. Read the same session.plan. Bounded native delegation disables the native tool. In streaming runs, finish reading the stream first.

  • None means no accepted update. A new update replaces the list. Empty steps clear it. A run without an update preserves the previous plan.
  • The SDK records the Python tool call ID or the native thread and turn IDs. Rejected updates leave the plan alone. Status reflects the agent's report. It neither verifies work nor schedules another run.
  • Public Python and JSON use steps and text. Older checkpoints remain readable. Upgrade readers before storing Python plans. Treat the contents as private. RunConfig.redact_text covers newly saved text, including the explanation.

Test plan

  • Exercised both Runner modes with the Python tool and the installed native tool against a loopback endpoint. Checked rejected updates, approval resumes sharing a context, handoffs, budget stops, redaction and reloads.
  • Reopened eight older approval records in both modes. Checked the public schema and an earlier native reader.
  • The repository verification script passed formatting, lint, type checks and 14,521 tests. Another 310 tests passed against the installed native wheel.
  • The standalone installation check for saving a native approval has been failing locally on both this revision and the earlier build. The hosted wheel jobs run the same check.

Checks

  • Added regression tests
  • Completed two independent reviews
  • Passed the repository verification script

@markstuart-oai
markstuart-oai requested review from a team, rm-openai and seratch as code owners November 21, 2026 14:10
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T23:53:02.773435Z 67c8ed6 New commits
🔒 Security Review ✅ Completed 2026-11-24T23:53:35.994700Z 67c8ed6 New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@jbeckwith-oai jbeckwith-oai left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved after comprehensive static review and an independent second review. Verified the pinned Core emits plan updates only after parsing accepted tool arguments and stamps the owning turn ID. Reviewed native thread identity, exact turn filtering, latest-update replacement and empty-plan clearing, immutable checkpoint data, backward reading of older checkpoints, atomic save behavior, approval resumes, nested-agent isolation, and both Runner paths. No actionable findings.

The checklist is display data, not tool authorization or a resumable native thread. Older SDK versions rejecting checkpoints containing the new field is documented. Hosted CI is complete: 33 passed and 2 skipped; no failures. Static review only; no candidate code or local tests executed.

Keep accepted checklists and pending native approvals on the same resumable session.

@jbeckwith-oai jbeckwith-oai left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved after static re-review of the base merge and independent integration review. Checked the replacement of the resumable boolean with the checkpoint object in both model call paths, equivalent native approval recovery gating, turn-correlated plan updates, and checklist persistence before the completed response. No actionable findings.

Hosted CI snapshot: {"success": 18, "in_progress": 6}. Unfinished checks remain tracked. Static review only; no candidate code or local tests executed.

Hosted CI complete at 0e4a4ba8577a84e32144c7fd0dd334d4ea79d818: {"success": 33, "skipped": 2}. No pending or failed checks. Static review only; no local tests executed.

Update feat/native-checklist against feat/simple-codex.

@jbeckwith-oai jbeckwith-oai left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-reviewed refreshed commit 723600fa77b04fba7dcade915bcb0822d832891b: approved.

Compared every changed file against the previously approved patch and reviewed its integration with the new base, including an independent reviewer. The substantive adaptation renames the final event variable to completed_event, preserving the base response object used during observation cleanup. Checklist assignment still occurs only after successful joined cleanup and before the terminal event. The new native-approval preflight hook context remains compatible. No actionable regression found; the prior comprehensive review remains applicable.

Current hosted CI: 15 in_progress, 9 success. Unfinished checks remain pending follow-up. Static review only; no candidate code or local tests executed.

Hosted CI follow-up (2026-11-22 22:10 UTC): current commit 723600fa77b04fba7dcade915bcb0822d832891b completed with 33 successful checks and 2 skipped checks. No failures. Static review only; no local tests executed.

Update feat/native-checklist against feat/simple-codex.

@jbeckwith-oai jbeckwith-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved after static re-review of 322e577f2cc3743cf11354dd6066bbad7878f35d. The base merge keeps the resumable field name used by hook-aware approval recovery while carrying the session adapter for checklist persistence. Both Runner constructors and Codex bindings agree on that representation. Checklist ownership and completed-response publication remain intact, and native approval input capture retains its resumable truthiness check. Independent review found no actionable regression.

Hosted CI at publication: {'SUCCESS': 17, 'IN_PROGRESS': 7}. Pending checks remain tracked. No candidate code or tests were executed locally.

Update feat/native-checklist against feat/simple-codex.

@jbeckwith-oai jbeckwith-oai left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved after static re-review and independent review. Checklist step text and explanations are scrubbed before constructing the immutable snapshot; native thread/turn ownership and completed-response publication remain intact. The full serialized checkpoint is checked at persistence, protected checkpoint version 2 is preserved, and prior checklist retention/empty-plan semantics remain unchanged. The added regression covers both Runner modes and reopening stored protected checklists. No actionable findings.

Hosted CI: 21 checks passed and 3 running at the latest observation; no failures. No candidate code or local tests executed.

CI follow-up (November 23): all hosted checks at this reviewed commit have completed: 33 passed and 2 skipped, including all eight wheel verifiers. The pending CI follow-up above is resolved. No candidate code or local tests executed.

Update feat/native-checklist against feat/simple-codex.

@jbeckwith-oai jbeckwith-oai left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved after static re-review and an independent second review at c4a6576. The checklist documentation accurately distinguishes an explicit empty plan from no update, and explains worker reload and active-checkpoint restrictions. Rechecked ownership, redaction, completed-response publication, checkpoint retention and the refreshed session integration; no actionable findings.

Hosted CI: 13 passed, 11 in progress; remaining checks need follow-up. No candidate code or local tests were executed.

Hosted CI follow-up (2026-11-24 03:37 UTC): Hosted checks finished with 31 passed, 3 skipped, and 1 failure. The Python 3.14 Linux wheel verifier fails test_worker_exit_joins_native_close at test_operation_tracing_parity.py:54 because the observed callback-thread list is empty; the other 22 parity tests pass. Independent static triage found the test and manager close path unchanged from the base. A fast executor completion can avoid call_soon_threadsafe, so this appears to be a test-observation race; the exact failed-run timing is unverified. Approval remains based on static code review, not green CI. This failure remains tracked. Static review only; no candidate code or local tests executed.

Hosted CI follow-up (2026-11-24 03:42 UTC): The failed wheel verifier is being rerun at the same commit. Latest check snapshot: 31 passed, 4 skipped, 1 running, and no current failures. The earlier failed attempt remains documented above; the rerun has not yet passed and remains tracked. No candidate code or local tests executed.

Hosted CI follow-up (2026-11-24 03:47 UTC): reruns at the same reviewed commit are complete. Latest check results: 33 passed and 6 skipped, with no pending or failed checks. The earlier failed attempt remains documented above; the current CI follow-up is resolved. No candidate code or local tests executed.

@jbeckwith-oai jbeckwith-oai left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved after static re-review and an independent second review. Checklist-bearing checkpoints now use versions 3/4, legacy 1/2 records remain readable and upgrade on write, and redacted versions 2/4 require a redactor before any store mutation. Rechecked active-claim promotion, checklist preservation including explicit empty plans, strict parsing, revision binding, and compare-and-swap behavior. The compatibility and redaction regression cases cover these transitions. No actionable findings.

Hosted CI at review: 18 passed and 6 running, with no failures. Remaining checks require follow-up. Static review only; no candidate code or local tests executed.

Hosted CI follow-up (2026-11-24 06:07 UTC): all checks at this reviewed commit are complete: 33 passed and 2 skipped, with no failures. The pending CI follow-up is resolved. Static review only; no candidate code or local tests executed.

Update feat/native-checklist against feat/simple-codex.
@markstuart-oai markstuart-oai changed the title feat: retain native checklists in resumable sessions Retain native checklists in resumable sessions Nov 24, 2026

@jbeckwith-oai jbeckwith-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Requesting changes for one checkpoint integration gap found during comprehensive static re-review and independent review. The Python steps/text API, persisted plan/step aliases, constructor validation and repr privacy changes otherwise look sound.

Hosted checks: {"success": 17, "in_progress": 7}. Unfinished checks remain tracked. No candidate code or local tests executed.

@jbeckwith-oai jbeckwith-oai left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved after static re-review and an independent second review. The budget-stop checkpoint now passes the staged Codex checklist through the same persistence path used by normal completion, addressing my previous request. The regression covers awaited and streamed budget stops, completed tool output, and restored checklist state. No additional actionable findings in the two-file fix.

Hosted CI at review: {"SKIPPED": 2, "SUCCESS": 17, "IN_PROGRESS": 7}. Remaining checks are tracked. Static review only; no candidate code or local tests executed.

Hosted CI update (2026-11-24 21:53 UTC): all reported checks at e6167ce are complete: 33 passed, 4 skipped, no failures or pending checks. Approval is unchanged. No local tests were run.

Update feat/native-checklist against feat/simple-codex.
@markstuart-oai markstuart-oai changed the title Retain native checklists in resumable sessions Save the last reported plan in a resumable session Nov 24, 2026

@jbeckwith-oai jbeckwith-oai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved after comprehensive static re-review and an independent second review. Reviewed the Plan/PlanStep API and update_plan tool, invocation-scoped proposal ownership, concurrent approval resumes, nested-session isolation, output guardrail/schema rejection, redaction, and persistence. Plan changes commit only after accepted tool processing; native updates remain turn-correlated. Existing checkpoints remain readable with the persisted plan/step field names, and the budget-stop persistence fix remains intact. No actionable findings.

Hosted CI at publication: 19 passed and 5 running, with no failures observed. Unfinished checks remain tracked. Static review only; no candidate code or local tests executed.

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.

2 participants