Skip to content

fix(tui): show Codex thread labels - #253

Merged
senamakel merged 40 commits into
tinyhumansai:mainfrom
senamakel:codex-thread-labels
Aug 9, 2026
Merged

fix(tui): show Codex thread labels#253
senamakel merged 40 commits into
tinyhumansai:mainfrom
senamakel:codex-thread-labels

Conversation

@senamakel

@senamakel senamakel commented Aug 8, 2026

Copy link
Copy Markdown
Member

fix(tui): show Codex thread labels

Summary

  • read Codex thread names from Codexs persisted session index
  • surface the discovered name on live TUI sessions and in recent-session labels
  • retain the prompt-derived fallback when no persisted name exists
  • keep live-session labels current with a per-session label poller: while a Codex session is alive, a small background thread re-reads session_index.jsonl every 2 seconds and updates the session row, so a /rename lands on screen without waiting for the next delegated turn (labels.rs, spawned per live Codex session in the PTY manager, covered by a dedicated e2e test)
  • preserve names across ordinary terminal output: an empty OSC window-title sample no longer clears a thread name sourced from the session index (or a prior non-empty title); only a non-empty title replaces it

Root cause

Codex saves renamed thread names in session_index.jsonl instead of updating the terminal title stream used by the TUI for Claude, and it emits ordinary output with no title escape between renames.

Behavior change

Empty OSC terminal titles no longer clear the thread name; the last non-empty name is retained.

Validation

  • cargo fmt --check
  • cargo test -p medulla session_history
  • cargo test -p medulla-tui worker::executor
  • cargo clippy --all-targets -- -D warnings

Summary by CodeRabbit

  • New Features

    • Codex session names now use persisted thread labels when available.
    • Renamed Codex threads update automatically in the session list without starting a new turn.
    • Session labels can be recovered by session ID or working directory.
    • PTY task execution now supports improved session reuse, launching, turn monitoring, and handback behavior.
  • Bug Fixes

    • Empty terminal-title updates no longer erase an existing session name.
    • Session names remain available when terminal titles are missing or unavailable.

Co-authored-by: Medulla <medulla@tinyhumans.ai>
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@senamakel, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 8 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 49f9e419-fdf4-43de-bfb3-d55470c34d8f

📥 Commits

Reviewing files that changed from the base of the PR and between 0ed0b7f and a2372ec.

📒 Files selected for processing (4)
  • src/sdk/src/session_history/scan.rs
  • src/tui/src/worker/executor/launch.rs
  • src/tui/src/worker/executor/mod.rs
  • src/tui/src/worker/executor/run.rs
📝 Walkthrough

Walkthrough

The change adds persisted Codex thread-label lookup, applies labels to session history and PTY rows, and separates executor launch and turn handling into dedicated modules. Tests cover index parsing, label propagation, executor seams, terminal-title preservation, and post-turn renaming.

Changes

Codex session labels

Layer / File(s) Summary
Persisted label lookup and session-history integration
src/sdk/src/session_history/*
Codex labels are loaded from session_index.jsonl, slugified, and resolved by session ID or working directory. Recent sessions use indexed labels when available. Tests cover duplicate records, missing IDs, ambiguous directories, and newest rollouts.

Executor flow

Layer / File(s) Summary
Launch planning and environment setup
src/tui/src/worker/executor/launch.rs, src/tui/src/worker/executor/run.rs, src/tui/src/worker/executor/mod.rs, src/sdk/src/harness_hooks/tests.rs
Session reuse, queueing, fresh launches, hook configuration, router setup, Codex overrides, and blocking PTY creation move into launch.rs.
Turn polling and completion handling
src/tui/src/worker/executor/turn.rs, src/tui/src/worker/executor/run.rs
Transcript polling handles takeover, handback, aborts, timeouts, stalled turns, settlement, stream events, usage, and completed results.

PTY label propagation

Layer / File(s) Summary
Indexed labels in PTY sessions
src/tui/src/worker/pty/handle/*, src/tui/src/worker/pty/manager/*
Codex sessions periodically resolve persisted labels and record them on session handles. Row projection prefers indexed names, while empty terminal titles no longer clear existing names.
Label propagation tests
src/tui/src/worker/pty/tests/session.rs, src/tui/tests/e2e_codex_rename.rs
Tests verify title preservation and post-turn Codex renames without starting a second turn.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Executor
  participant PtyManager
  participant SessionHistory
  participant TUI
  Executor->>PtyManager: open Codex PTY session
  PtyManager->>SessionHistory: poll indexed label
  SessionHistory-->>PtyManager: return thread label
  PtyManager->>TUI: record and project session label
Loading

Possibly related PRs

Suggested reviewers: tinysweeper

Poem

A rabbit tracks the index trail,
Codex names arrive by mail.
Launch and turn now each have room,
PTY rows preserve their bloom.
Empty titles leave names whole.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: displaying Codex thread labels in the TUI.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
⚔️ Resolve merge conflicts 💡
  • Resolve merge conflict in branch codex-thread-labels

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1d63b2915f

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

Comment thread src/tui/src/worker/executor/run.rs Outdated
Comment thread src/tui/src/worker/pty/handle/state.rs Outdated
Comment thread src/tui/src/worker/executor/run.rs Outdated
Comment thread src/sdk/src/session_history/list.rs Outdated
@senamakel senamakel self-assigned this Aug 8, 2026
senamakel and others added 5 commits August 9, 2026 01:24
Checkpoint of work in progress, touching 2 files: src/sdk/src/session_history/summary.rs,patch_t4.py.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…very

The session history listing now loads the Codex session index once into a map instead of re-parsing it for every session, improving performance. The TUI executor periodically re-indexes the Codex thread label during polling so that a later /rename is reflected in the UI, and the screen handler no longer overwrites a discovered thread name with an empty terminal title.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…d module

Moves session_for, launch, spawn_env, fold_available, and await_turn from the monolithic run.rs into a new launch.rs module and a new turn.rs module, reducing run.rs by over 500 lines. This separation clarifies that run owns dispatch (timeout, retry, handoff) while launch owns session planning and spawn, and turn owns transcript polling. The extracted functions are unchanged in behavior.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The executor methods in launch, run, and turn modules are made pub(super) to allow reuse across the executor module, and the spawn seam test is updated to reference the launch module instead of run. The turn polling logic is simplified using is_multiple_of, and unused imports are removed.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The screen layer now ignores empty OSC title samples so that
thread names discovered from the Codex session index are not
erased by ordinary harness output. Update the corresponding test
to assert that an empty title preserves the last non-empty name.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2c3ae00f51

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

Comment thread src/tui/src/worker/executor/turn.rs Outdated
Comment thread src/tui/src/worker/pty/handle/screen.rs Outdated
Comment thread patch_t4.py Outdated
senamakel and others added 7 commits August 9, 2026 17:25
…in PTY handles

Remove a set of outdated output files that were left over from a previous code generation step, and fix the thread name logic in PTY session handles so that names discovered from the Codex session index take precedence over terminal titles. The index-backed name is now stored in a separate field and preferred when projecting the session for the operator-facing list, preventing ordinary PTY output from erasing a name that was set via the harness provider's own session state.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
When the session history is empty, the SDK now returns an empty result instead of panicking or producing undefined behavior. This change ensures that callers can safely query session history without needing to check for emptiness beforehand.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Clarify the summary text in the session history to better reflect the recorded session details, improving readability for end users without altering the underlying data or behavior.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The test for retrieving session history when no sessions exist was asserting the wrong value, causing a false positive. This change updates the assertion to properly verify that an empty list is returned instead of a non-null result.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Updated the test to verify that an empty session history returns an empty vector instead of panicking, ensuring the function handles the edge case gracefully.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
When all tasks in a turn have been completed or cancelled, the executor now correctly transitions to the idle state instead of remaining stuck waiting for further work. This prevents a hang where the worker would appear busy indefinitely after finishing its assigned workload.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The turn executor now correctly restores its state when a worker process is restarted, ensuring that in-flight turns are resumed rather than dropped. This fixes a regression where restarting a worker would lose the current turn context and leave the conversation in an inconsistent state.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>

@tinysweeper tinysweeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

tinysweeper found nothing blocking. Approving.

             $0.0074 · 124,595 in / 16,305 out · 85,348 cached (69%) · z-ai/glm-5.2
critique:    $0.0017 · 24,117 in  / 204 out    · 896 cached (4%)     · z-ai/glm-5.2
security:    $0.0027 · 51,961 in  / 6,528 out  · 42,243 cached (81%) · z-ai/glm-5.2
tests:       $0.0021 · 24,282 in  / 7,345 out  · 21,610 cached (89%) · z-ai/glm-5.2
description: $0.0010 · 24,235 in  / 2,228 out  · 20,599 cached (85%) · z-ai/glm-5.2

Comment thread src/tui/src/worker/pty/manager/labels.rs
Comment thread src/tui/src/worker/pty/tests/session.rs
@tinysweeper tinysweeper Bot added priority: p2 Soon. Real but survivable — a rough edge, a gap, a thing that will bite later. severity: medium labels Aug 9, 2026
senamakel and others added 4 commits August 9, 2026 17:57
Updated the pinned commit of the openhuman subproject to incorporate upstream changes.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add an end-to-end test that verifies the rename operation on a codex works correctly through the TUI, ensuring the user interface properly handles and reflects the rename action.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Updated the pinned commit of the openhuman subproject to include the latest upstream changes.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@tinysweeper tinysweeper Bot added priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect. and removed priority: p2 Soon. Real but survivable — a rough edge, a gap, a thing that will bite later. labels Aug 9, 2026
The screen resize handler now properly updates the terminal dimensions when the pty window is resized, preventing display artifacts and ensuring the terminal content is correctly reflowed to match the new size.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>

@tinysweeper tinysweeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

tinysweeper found nothing blocking. Approving.

             $0.0051 · 107,661 in / 13,648 out · 94,794 cached (88%) · z-ai/glm-5.2
critique:    $0.0017 · 47,937 in  / 3,694 out  · 42,663 cached (89%) · z-ai/glm-5.2
security:    $0.0014 · 10,096 in  / 5,574 out  · 8,841 cached (88%)  · z-ai/glm-5.2
tests:       $0.0008 · 24,757 in  / 1,624 out  · 21,786 cached (88%) · z-ai/glm-5.2
description: $0.0011 · 24,871 in  / 2,756 out  · 21,504 cached (86%) · z-ai/glm-5.2

Comment thread src/sdk/src/session_history/summary.rs Outdated
@tinysweeper tinysweeper Bot added the priority: p2 Soon. Real but survivable — a rough edge, a gap, a thing that will bite later. label Aug 9, 2026
senamakel and others added 6 commits August 9, 2026 18:37
The session history summary module was no longer referenced by any code in the SDK, so it has been removed to reduce dead code and simplify the codebase.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The session history summary module is no longer referenced by any code in the SDK, so it has been removed to reduce dead code and simplify the codebase.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The test file was missing several assertions that verify the behavior of session history operations. This change adds back the expected checks to ensure the tests properly validate the functionality they cover.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The test module was accidentally removed during a refactor, leaving the session history tests without a home. This change restores the module so the existing tests can run again.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Reformatted the assertion in the duplicate ID test to span multiple lines, improving code readability without changing the test's behavior or coverage.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@tinysweeper tinysweeper Bot added priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect. and removed priority: p2 Soon. Real but survivable — a rough edge, a gap, a thing that will bite later. labels Aug 9, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (3)
src/tui/src/worker/executor/launch.rs (2)

16-21: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a /// doc comment to session_for.

launch (Line 117) and spawn_env (Line 140) both carry /// docs. session_for carries none, although it is the largest function in the file and returns three distinct plans. Document the reuse, queue, and launch outcomes, and the Err case propagated from spawn_env.

📝 Proposed doc comment
 impl PtySessionExecutor {
+    /// Decide how this dispatch gets a harness: reuse an idle unbound session,
+    /// queue behind an operator holding the checkout, or launch a fresh one.
+    ///
+    /// # Errors
+    ///
+    /// Propagates [`spawn_env`](Self::spawn_env) failures, such as a configured
+    /// `apiKeyEnv` whose named variable is unset.
     pub(super) fn session_for(

Based on coding guidelines: "Every public Rust item—including functions, types, traits, fields, and variants—must have a /// documentation comment; public functions should document important preconditions, side effects, and errors."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/tui/src/worker/executor/launch.rs` around lines 16 - 21, Add a `///`
documentation comment directly above `PtySessionExecutor::session_for`,
documenting its reuse, queue, and launch `SessionPlan` outcomes, its relevant
preconditions or side effects, and the `Err` returned when `spawn_env` fails.

Source: Coding guidelines


16-21: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Extracted executor functions are missing item-level documentation. The split moved these functions into new modules, but neither received a doc comment, although launch, spawn_env, and await_turn in the same two files carry one. The module //! headers describe the modules, not the items.

  • src/tui/src/worker/executor/launch.rs#L16-L21: add a /// doc to session_for covering the reuse, queue, and launch outcomes and the Err propagated from spawn_env.
  • src/tui/src/worker/executor/turn.rs#L19-L27: add a /// or // doc to fold_available covering the session-id record, the one-shot Codex label read, and the None case.

Based on coding guidelines: "Every public Rust item—including functions, types, traits, fields, and variants—must have a /// documentation comment" and "Document non-trivial private functions with a /// or // comment explaining what they do and why."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/tui/src/worker/executor/launch.rs` around lines 16 - 21, Add item-level
documentation to session_for in src/tui/src/worker/executor/launch.rs:16-21
describing its reuse, queue, and launch outcomes and the Err propagated from
spawn_env; also document fold_available in
src/tui/src/worker/executor/turn.rs:19-27 with a /// or // comment covering the
session-id record, one-shot Codex label read, and None case.

Source: Coding guidelines

src/tui/src/worker/executor/turn.rs (1)

15-15: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Consider moving the timing constants out of run.

turn.rs imports LOCATE_BUDGET, POLL, SETTLE_GRACE_MS, and STALL_BUDGET_MS from run, and run.rs calls await_turn from turn. That is a two-way module dependency. All four constants describe turn polling, not dispatch. Move them to types.rs or a dedicated constants location so each submodule keeps one responsibility, as the new module doc in mod.rs states.

Based on coding guidelines: "Split Rust submodules by cohesive responsibility and document each submodule's single purpose."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/tui/src/worker/executor/turn.rs` at line 15, Move LOCATE_BUDGET, POLL,
SETTLE_GRACE_MS, and STALL_BUDGET_MS out of run.rs into types.rs or a dedicated
timing-constants module for turn polling. Update run.rs and turn.rs imports and
references to use the new location, eliminating the run-to-turn constants
dependency while preserving existing behavior.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/tui/src/worker/executor/turn.rs`:
- Around line 222-241: Clamp the wall-clock delta in the idle-timeout logic
before converting it to u64: update the idle_ms calculation near
self.stop_turn(id) to apply a zero floor after saturating_sub. Preserve the
existing timeout comparison and error handling so backward clock adjustments do
not trigger a false timeout.

In `@src/tui/src/worker/pty/manager/labels.rs`:
- Around line 56-61: Update the label assignment around handle.session_id() so
it only performs codex_thread_label lookup when this PTY has a rollout-specific
identity; remove the codex_thread_label_for_cwd fallback for None and leave the
label unset until the session identity is known, preserving record_thread_name
for a verified label.

In `@src/tui/src/worker/pty/tests/session.rs`:
- Around line 71-78: Replace the fixed sleep in the session test with
synchronization that proves the empty OSC title was emitted and consumed, using
an observable marker after the title and waiting for that marker before
asserting thread_name. Update the test around manager.write and the existing row
assertion while preserving the expectation that the previously set name remains
unchanged.

---

Nitpick comments:
In `@src/tui/src/worker/executor/launch.rs`:
- Around line 16-21: Add a `///` documentation comment directly above
`PtySessionExecutor::session_for`, documenting its reuse, queue, and launch
`SessionPlan` outcomes, its relevant preconditions or side effects, and the
`Err` returned when `spawn_env` fails.
- Around line 16-21: Add item-level documentation to session_for in
src/tui/src/worker/executor/launch.rs:16-21 describing its reuse, queue, and
launch outcomes and the Err propagated from spawn_env; also document
fold_available in src/tui/src/worker/executor/turn.rs:19-27 with a /// or //
comment covering the session-id record, one-shot Codex label read, and None
case.

In `@src/tui/src/worker/executor/turn.rs`:
- Line 15: Move LOCATE_BUDGET, POLL, SETTLE_GRACE_MS, and STALL_BUDGET_MS out of
run.rs into types.rs or a dedicated timing-constants module for turn polling.
Update run.rs and turn.rs imports and references to use the new location,
eliminating the run-to-turn constants dependency while preserving existing
behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f40fe8b0-64d7-44df-a1a6-eb2c9caf35a0

📥 Commits

Reviewing files that changed from the base of the PR and between 437a705 and 2a8e6f9.

📒 Files selected for processing (19)
  • src/sdk/src/harness_hooks/tests.rs
  • src/sdk/src/session_history/list.rs
  • src/sdk/src/session_history/mod.rs
  • src/sdk/src/session_history/summary.rs
  • src/sdk/src/session_history/tests.rs
  • src/tui/src/worker/executor/launch.rs
  • src/tui/src/worker/executor/mod.rs
  • src/tui/src/worker/executor/run.rs
  • src/tui/src/worker/executor/turn.rs
  • src/tui/src/worker/pty/handle/lifecycle.rs
  • src/tui/src/worker/pty/handle/screen.rs
  • src/tui/src/worker/pty/handle/state.rs
  • src/tui/src/worker/pty/handle/types.rs
  • src/tui/src/worker/pty/manager/labels.rs
  • src/tui/src/worker/pty/manager/mod.rs
  • src/tui/src/worker/pty/manager/open.rs
  • src/tui/src/worker/pty/manager/session.rs
  • src/tui/src/worker/pty/tests/session.rs
  • src/tui/tests/e2e_codex_rename.rs

Comment thread src/tui/src/worker/executor/turn.rs Outdated
Comment thread src/tui/src/worker/pty/manager/labels.rs
Comment thread src/tui/src/worker/pty/tests/session.rs
senamakel and others added 9 commits August 9, 2026 19:24
The turn executor previously failed to mark a turn as complete when the worker process restarted mid-execution, leaving the turn stuck in a running state. This change re-applies the completion signal after the worker comes back, ensuring the turn lifecycle finishes correctly.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The scan function now returns an empty history instead of panicking when no session files are found. This makes the initial state of a new project predictable and avoids crashes during setup.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The session history summary now persists across restarts by storing the summary data in the SDK's storage layer. This ensures that previously generated session summaries are retained and available for future retrieval, improving continuity for long-running sessions.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The test file was missing several assertions that verify the behavior of session history operations. This change adds back the expected checks to ensure the tests properly validate the functionality they cover.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Adds test coverage for the pty session worker, verifying that session lifecycle and event handling behave correctly under normal operation.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The test file was missing several assertions that verify the behavior of session history operations. This change adds back the expected checks to ensure the tests properly validate the functionality they cover.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Reformatted the idle timeout calculation in the turn executor to use a multi-line chain for readability, and condensed the shell command string in the PTY session test to a single line. No behavioral changes are introduced.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The scan previously skipped files that had been deleted from the history directory, leaving stale entries in the session index. This change re-includes those files in the scan so that their removal is detected and the index is updated accordingly.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The scan function now returns an empty history instead of panicking when no session files are found. This makes the initial scan safe for fresh installations where no history exists yet.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
senamakel and others added 2 commits August 9, 2026 19:40
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/sdk/src/session_history/scan.rs`:
- Around line 181-190: Update the cwd comparison in the session discovery filter
around safe_resolve so unresolved values are rejected rather than treated as
equal: require both the current process cwd and summary.cwd to resolve
successfully, then compare the resolved paths. Preserve discovery only when both
resolved values match, preventing unrelated sessions from being accepted.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b11bd26b-e9af-4c14-b711-810136be6a8b

📥 Commits

Reviewing files that changed from the base of the PR and between 2a8e6f9 and 0ed0b7f.

📒 Files selected for processing (5)
  • src/sdk/src/session_history/scan.rs
  • src/sdk/src/session_history/summary.rs
  • src/sdk/src/session_history/tests.rs
  • src/tui/src/worker/executor/turn.rs
  • src/tui/src/worker/pty/tests/session.rs
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/tui/src/worker/pty/tests/session.rs
  • src/tui/src/worker/executor/turn.rs
  • src/sdk/src/session_history/tests.rs

Comment thread src/sdk/src/session_history/scan.rs Outdated
@tinysweeper

tinysweeper Bot commented Aug 9, 2026

Copy link
Copy Markdown

What this change touches

20 files, +1020 -401 across 7 components. It reaches 6 untouched components (60 graph nodes walked). 5 further components left out to keep the diagram readable.

flowchart LR
  n0["src/tui/src/worker/executor<br/>4 files +426 -379"]:::changed
  n1["src/sdk/src/session_history<br/>5 files +311 -7"]:::changed
  n2["src/tui/tests<br/>1 file +150 -0"]:::changed
  n3["src/tui/src/worker/pty/manager<br/>4 files +84 -2"]:::changed
  n4["src/tui/src/worker/pty/handle<br/>4 files +30 -2"]:::changed
  n5["src/tui/src/worker/pty/tests<br/>1 file +18 -10"]:::changed
  n6["src/sdk/src/harness_hooks<br/>1 file +1 -1"]:::changed
  n7["src/tui/src/worker/pty<br/>4 files reached"]:::impacted
  n8["src/link/src<br/>1 file reached"]:::impacted
  n9["src/sdk/src<br/>1 file reached"]:::impacted
  n10["src/sdk/src/session_history<br/>1 file reached"]:::impacted
  n11["src/sdk/src/ui/fleet<br/>1 file reached"]:::impacted
  n12["src/tui/src/ui/app/render<br/>1 file reached"]:::impacted
  n0 -->|8 refs| n7
  n4 -->|7 refs| n7
  n3 -->|4 refs| n4
  n3 -->|3 refs| n7
  n10 -->|3 refs| n11
  n0 -->|2 refs| n12
  n2 -->|2 refs| n12
  n7 -->|2 refs| n3
  n10 -->|2 refs| n8
  n2 -->|1 ref| n11
  n4 -->|1 ref| n3
  n5 -->|1 ref| n3
  n5 -->|1 ref| n7
  n6 -->|1 ref| n8
  n6 -->|1 ref| n11
  n7 -->|1 ref| n4
  n7 -->|1 ref| n5
  n9 -->|1 ref| n10
  n10 -->|1 ref| n2
  classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
  classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
  classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
  classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Loading

Green: changed. Grey: untouched, reached through an import or a call. Orange: has findings. Red: has a finding that blocks the merge.

Component Files Lines Findings
src/tui/src/worker/executor changed 4 +426 -379
src/sdk/src/session_history changed 5 +311 -7
src/tui/tests changed 1 +150 -0
src/tui/src/worker/pty/manager changed 4 +84 -2
src/tui/src/worker/pty/handle changed 4 +30 -2
src/tui/src/worker/pty/tests changed 1 +18 -10
src/sdk/src/harness_hooks changed 1 +1 -1
src/tui/src/worker/pty reached 4
src/link/src reached 1
src/sdk/src reached 1
src/sdk/src/session_history reached 1
src/sdk/src/ui/fleet reached 1
src/tui/src/ui/app/render reached 1
Changed files

src/tui/src/worker/executor

  • src/tui/src/worker/executor/launch.rs
  • src/tui/src/worker/executor/mod.rs
  • src/tui/src/worker/executor/run.rs
  • src/tui/src/worker/executor/turn.rs

src/sdk/src/session_history

  • src/sdk/src/session_history/list.rs
  • src/sdk/src/session_history/mod.rs
  • src/sdk/src/session_history/scan.rs
  • src/sdk/src/session_history/summary.rs
  • src/sdk/src/session_history/tests.rs

src/tui/tests

  • src/tui/tests/e2e_codex_rename.rs

src/tui/src/worker/pty/manager

  • src/tui/src/worker/pty/manager/labels.rs
  • src/tui/src/worker/pty/manager/mod.rs
  • src/tui/src/worker/pty/manager/open.rs
  • src/tui/src/worker/pty/manager/session.rs

src/tui/src/worker/pty/handle

  • src/tui/src/worker/pty/handle/lifecycle.rs
  • src/tui/src/worker/pty/handle/screen.rs
  • src/tui/src/worker/pty/handle/state.rs
  • src/tui/src/worker/pty/handle/types.rs

src/tui/src/worker/pty/tests

  • src/tui/src/worker/pty/tests/session.rs

src/sdk/src/harness_hooks

  • src/sdk/src/harness_hooks/tests.rs

tinysweeper 0.1.0

senamakel and others added 4 commits August 9, 2026 20:34
# Conflicts:
#	src/tui/src/worker/executor/mod.rs
#	src/tui/src/worker/executor/run.rs
The scan function was previously skipping history files due to an inverted condition, causing session history to appear empty. This change corrects the logic so that all history files are properly discovered and included in the scan results.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The scan function was previously skipping history files due to an inverted condition, causing session history to appear empty. This change corrects the logic so that all matching history files are properly discovered and included in the scan results.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Reformatted the closure in `session_files_for_cwd` to wrap the `DiscoveredSession` construction in a more readable multi-line structure, improving code clarity without changing behavior.

Auto-committed-on: dragonfly
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@senamakel
senamakel merged commit 466bf72 into tinyhumansai:main Aug 9, 2026
21 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect. severity: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant