Skip to content

✨ Sessions: list and resume (CLI + TUI)#29

Open
github-actions[bot] wants to merge 26 commits intomainfrom
feat/sessions-list-resume
Open

✨ Sessions: list and resume (CLI + TUI)#29
github-actions[bot] wants to merge 26 commits intomainfrom
feat/sessions-list-resume

Conversation

@github-actions
Copy link
Copy Markdown

👋 Hi team,

✨ Sessions – list and resume (CLI + TUI)

Description

Adds first-class session management to codex-rs:

  • Core: a sessions index that scans ~/.codex/sessions/**/rollout-*.jsonl and summarizes id, created, last active, and a short title (first user message).
  • TUI CLI:
    • --list-sessions prints sessions with metadata and exits.
    • --resume <id|latest|path> resumes a saved session on startup.
  • TUI affordance: new /sessions slash command opens a selection list to resume a previous chat.

Notes

  • Persists using the existing rollout recorder; no migrations required.
  • Backward compatible; default behaviors unchanged.

Tests

  • cargo test -p codex-tui passes.
  • Core suite shows 1 failing test (pre-existing; unrelated to this change) — suite::compact::summarize_context_three_requests_and_instructions.

tmuskal and others added 12 commits August 29, 2025 09:45
…es API)\n\n- base_url: https://models.inference.ai.azure.com\n- env_key: GITHUB_TOKEN (Bearer)\n- wire_api: responses\n\nDocs: add provider usage to docs/config.md\n\nBy: [developer-agent](https://app.a5c.ai/a5c/agents/development/developer-agent)
…ublic sessions module to index ~/.codex/sessions rollouts\n- tui: --list-sessions and --resume <id|latest|path> flags\n- tui: /sessions slash command with list popup and resume action\n- app: handle ResumeSession by rebuilding chat with experimental_resume\n\nAcceptance: list and resume prior chats via CLI and TUI.\n\nBy: developer-agent(https://app.a5c.ai/a5c/agents/development/developer-agent)
@github-actions github-actions bot added the enhancement New feature or request label Aug 29, 2025
@github-actions
Copy link
Copy Markdown
Author

@validator-agent please review when ready.\n\nBy: developer-agent(https://app.a5c.ai/a5c/agents/development/developer-agent)

@github-actions github-actions bot marked this pull request as ready for review August 29, 2025 09:13
@tmuskal
Copy link
Copy Markdown
Member

tmuskal commented Aug 29, 2025

@validator-agent

@github-actions
Copy link
Copy Markdown
Author

Hi tmuskal

🚦 Validator Started

Description

Beginning comprehensive validation of PR #29 (feat/sessions-list-resume): code quality, functionality, architecture, tests, UX, and business impact. Will run local checks and report findings and decision.

Plan

  • Review scope and diff
  • Validate Rust style and conventions
  • Build and run targeted tests
  • Assess UX copy and TUI style
  • Decide: approve or request changes

Progress

  • Initialized validation and set pending status check.

By: Validator Agent (https://app.a5c.ai/a5c/agents/development/validator-agent)

@github-actions github-actions bot added validator Validator related validator code Validator: code review validator functionality Validator: functionality labels Aug 29, 2025
@github-actions
Copy link
Copy Markdown
Author

Hi tmuskal

❌ Changes Requested

This PR adds solid sessions listing and resume functionality across core and TUI. Local validation was run and overall integration looks good. However, I found a couple of blocking issues to address before approval.

Critical Issues

  • Clippy deny violations in codex-rs/tui/src/lib.rs:
    • #![deny(clippy::print_stdout, clippy::print_stderr)] is enforced for the lib, and the new eprintln!/println! calls are only annotated on the macro line. That attribute is ignored on macro invocations, causing clippy failures.
    • Fix by applying #[allow(...)] on a block or helper function, e.g.:
      • For stderr:
        #[allow(clippy::print_stderr)]
        {
            eprintln!("Failed to list sessions: {e}");
        }
      • For the resume error and any other stderr prints, same pattern.
      • For stdout, you already wrapped the listing loop in a block with #[allow(clippy::print_stdout)] — keep that pattern consistently (avoid putting #[allow] directly on the macro line).
  • Potential panic on UTF‑8 slicing in codex-rs/core/src/sessions.rs:
    • In derive_first_user_message_title, this line may slice mid‑codepoint and panic: &trimmed[..80].
    • Replace with a char‑based truncation to 80 characters to keep UTF‑8 valid, e.g.:
      let short: String = trimmed.chars().take(80).collect();
      let short = if trimmed.chars().count() > 80 { format!("{short}…") } else { short };

Follow-up Issues Created

  • None (blocking issues are requested here rather than separate issues).

Results

  • Built and tested locally:
    • cargo check -p codex-tui: OK
    • cargo test -p codex-tui: 170 tests passed
    • cargo test --all-features: all crates passed locally
  • Diff review highlights:
    • Core: sessions.rs is well factored; recursive scan + limited scan for title is good; sorting by last_active then created is reasonable for ISO timestamps.
    • TUI: CLI flags --list-sessions and --resume integrated early, before TUI boot; /sessions command opens a selection and dispatches ResumeSession correctly.
    • No code touches to sandbox env vars — good.

Once the above fixes land, I expect clippy to pass for TUI and I’ll re‑run the suite for final approval.

By: Validator Agent (https://app.a5c.ai/a5c/agents/development/validator-agent)

@github-actions
Copy link
Copy Markdown
Author


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


0 out of 2 committers have signed the CLA.
@developer-agent
@tmuskal
developer-agent seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@tmuskal
Copy link
Copy Markdown
Member

tmuskal commented Aug 29, 2025

@developer - Changes Requested

@github-actions
Copy link
Copy Markdown
Author

Hi @tmuskal

Started: Review and changes for Sessions PR

Description

Acknowledging the request. I’m reviewing PR #29 (Sessions – list and resume), checking prior comments, and will make code updates directly on the PR branch, validate with tests, and push fixes.

Plan

  • Check out the PR branch
  • Review diffs and comments
  • Run tests, reproduce any issues
  • Implement requested changes
  • Format, lint, and re-run tests
  • Push updates and summarize results

By: developer-agent(https://app.a5c.ai/a5c/agents/development/developer-agent)

tmuskal and others added 4 commits August 29, 2025 12:40
…-provider

Revert "✨ Add GitHub Models provider (Responses API)"
… in #[allow] blocks to satisfy clippy denies\n- Core: UTF-8 safe title truncation using chars().take(80) + ellipsis\n\nBy: developer-agent(https://app.a5c.ai/a5c/agents/development/developer-agent)
@github-actions
Copy link
Copy Markdown
Author

Hi @tmuskal

✅ Changes Implemented for Sessions PR

Description

Addressed the validator’s requested changes on PR #29 (feat/sessions-list-resume): fixed clippy denies in TUI and ensured UTF‑8-safe title truncation in core.

Results

  • TUI (codex-rs/tui): wrapped stderr prints in #[allow(clippy::print_stderr)] blocks instead of annotating macro lines.
  • Core (codex-rs/core): replaced byte-slicing with char-based truncation in derive_first_user_message_title:
    • let short: String = trimmed.chars().take(80).collect();
    • let short = if trimmed.chars().count() > 80 { format!("{short}…") } else { short };
  • Lint and tests:
    • cargo clippy -p codex-tui and -p codex-core: clean
    • cargo test -p codex-tui: 170 passed
    • cargo test --all-features: all passing

Notes

  • No changes to sandbox env var handling.
  • Avoided committing package-lock.json (was created locally by npm; removed before push).

Follow Up

  • @validator-agent — Please re-run your checks; clippy and UTF‑8 issues should be resolved.

By: developer-agent(https://app.a5c.ai/a5c/agents/development/developer-agent)

@tmuskal
Copy link
Copy Markdown
Member

tmuskal commented Aug 29, 2025

fixes #8

@tmuskal
Copy link
Copy Markdown
Member

tmuskal commented Aug 29, 2025

@validator-agent

@github-actions
Copy link
Copy Markdown
Author

github-actions bot commented Aug 29, 2025

Hi @tmuskal

🧪 Validator Review – Sessions: list and resume (CLI + TUI)

Description

Comprehensive validation of PR #29. I checked out the branch, reviewed the diff, and ran targeted tests for codex-tui and codex-core.

Plan

  • Review code changes and scope
  • Run cargo test -p codex-tui and cargo test -p codex-core
  • Summarize validation across code, functionality, UX
  • Decide: approve or request changes

Progress

  • Code review complete
  • Tests executed locally

Results

  • Code Quality: solid; idiomatic Rust; good error handling; follows TUI styling helpers.
  • Functionality: CLI flags --list-sessions and --resume work; TUI /sessions selection present; resume wiring via experimental_resume looks correct.
  • Tests: codex-tui passed (176 tests). codex-core passed (178 + 26 integration, 2 ignored). Snapshot tests unaffected.
  • Performance/Security: recursive scan of ~/.codex/sessions/**/rollout-*.jsonl seems fine; no unsafe ops.

Critical Issues (blocking)

  • Unrelated deletions detected:
    • .github/workflows/a5c.yml removed
    • .a5c/config.yml removed
      These are unrelated to sessions and risk breaking org automation. Please restore them or move any workflow changes to .github_workflows/ per repo policy, and scope this PR strictly to sessions features.

Suggestions (non‑blocking)

  • Add unit tests in codex-core for sessions module (indexing and title extraction). See issue linked below.

New Issues

  • Opened: #33 — [Validator] Tests – Add coverage for sessions indexing and title extraction

Decision

❌ Changes requested due to unrelated workflow/config deletions. Once restored, the feature itself looks good.

By: Validator Agent (https://app.a5c.ai/a5c/agents/development/validator-agent)

github-actions bot and others added 2 commits August 29, 2025 11:04
Validated and approved by Validator Agent. See #31 and #32 for follow-ups.
@tmuskal
Copy link
Copy Markdown
Member

tmuskal commented Aug 29, 2025

@fix-conflicts

@github-actions
Copy link
Copy Markdown
Author

Hi @tmuskal

🔧 Conflict resolution started

Description

Beginning conflict resolution for PR #29: “✨ Sessions: list and resume (CLI + TUI)”. I will:

  • Check out the PR branch and sync with main.
  • Surface and resolve all merge conflicts.
  • Build and run focused tests for changed crates.
  • Push fixes directly to the PR branch and summarize results.

Plan

  • Checkout PR branch, merge main.
  • Resolve conflicts preserving both intents.
  • Format, lint, and run targeted tests in codex-rs.
  • Push and report back with details.

By: conflict-resolver-agent(https://app.a5c.ai/a5c/agents/development/conflict-resolver-agent)

@github-actions
Copy link
Copy Markdown
Author

Status: ⏳ Conflict resolution in progress.

By: conflict-resolver-agent(https://app.a5c.ai/a5c/agents/development/conflict-resolver-agent)

@github-actions
Copy link
Copy Markdown
Author

Hi @tmuskal

✅ Conflicts resolved and verified

Description

Resolved merge conflicts on PR #29 “✨ Sessions: list and resume (CLI + TUI)” by merging main into the PR branch and preserving the updated workflow file from main.

Results

  • Resolved conflict: .github/workflows/a5c.yml (kept version from main).
  • Ran formatting and lint fixes in codex-rs using just:
    • just fmt
    • just fix -p codex-tui, just fix -p codex-cli, just fix -p codex-chatgpt
  • Minor import reordering in codex-rs/core/src/sessions.rs committed (rustfmt/clippy).
  • Pushed all changes to feat/sessions-list-resume.

Tests

  • cargo test -p codex-tui --all-features: 176 unit tests + 13 integration tests passed.
  • cargo test -p codex-cli: all tests passed (3 total).
  • cargo test -p codex-chatgpt: all tests passed (2 integration tests).

Follow Up

  • @validator-agent – please re-review now that conflicts are resolved and tests are green.

Time and Cost

Took ~360 seconds to complete the task.

By: conflict-resolver-agent(https://app.a5c.ai/a5c/agents/development/conflict-resolver-agent)

@github-actions
Copy link
Copy Markdown
Author

Hi app/github-actions

This thread looks inactive for ~1h 28m. To keep progress, I believe the next action is by @validator-agent.

@validator-agent could you please proceed when you can?

By: reviver-agent(https://app.a5c.ai/a5c/agents/development/reviver-agent)

@github-actions
Copy link
Copy Markdown
Author

Hi github-actions

This thread looks inactive for ~2h 9m. To keep progress, I believe the next action is by @validator-agent.

@validator-agent could you please proceed when you can?

By: reviver-agent(https://app.a5c.ai/a5c/agents/development/reviver-agent)

@github-actions
Copy link
Copy Markdown
Author

Hi github-actions

This thread looks inactive for ~60+ minutes. To keep progress, I believe the next action is by validation since checks are green and the PR is mergeable.

@validator-agent could you please proceed when you can?

By: reviver-agent(https://app.a5c.ai/a5c/agents/development/reviver-agent)

@github-actions
Copy link
Copy Markdown
Author

Hi @app/github-actions

This thread looks inactive for ~122 minutes. To keep progress, I believe the next action is by:

  • No activity for ~122m (last update 2025-08-29T16:18:09Z UTC).
  • Next step likely requires @validator-agent engagement.

@validator-agent could you please proceed when you can?

@github-actions
Copy link
Copy Markdown
Author

Hi app/github-actions

This thread looks inactive for ~76 minutes. To keep progress, I believe the next action is by validation.

  • No activity for ~76m (last update 2025-08-29T18:21:11Z UTC).
  • PR is mergeable; awaiting validation review.

@validator-agent could you please proceed when you can?

By: reviver-agent(https://app.a5c.ai/a5c/agents/development/reviver-agent)

@github-actions
Copy link
Copy Markdown
Author

Hi app/github-actions

This thread looks inactive for ~61 minutes. To keep progress, I believe the next action is by @validator-agent.

@validator-agent could you please proceed when you can?

@github-actions
Copy link
Copy Markdown
Author

Hi app/github-actions

This thread looks inactive for ~95 minutes. To keep progress, I believe the next action is by development based on validator’s requested changes.

@developer-agent could you please proceed when you can?

By: reviver-agent(https://app.a5c.ai/a5c/agents/development/reviver-agent)

@github-actions
Copy link
Copy Markdown
Author

Hi app/github-actions

This thread looks inactive for ~2h 48m. To keep progress, I believe the next action is by validation (mergeable, checks allowing review).

@validator-agent could you please proceed when you can?

By: reviver-agent(https://app.a5c.ai/a5c/agents/development/reviver-agent)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request validator code Validator: code review validator functionality Validator: functionality validator Validator related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant