Skip to content

Remove dead rolling recap helper#4572

Open
ahfoysal wants to merge 2 commits into
tinyhumansai:mainfrom
ahfoysal:ahfoysal/remove-dead-rolling-recap
Open

Remove dead rolling recap helper#4572
ahfoysal wants to merge 2 commits into
tinyhumansai:mainfrom
ahfoysal:ahfoysal/remove-dead-rolling-recap

Conversation

@ahfoysal

@ahfoysal ahfoysal commented Jul 5, 2026

Copy link
Copy Markdown

Summary

Removes the unused rolling_segment_recap helper from the archivist recap module and updates the nearby rustdoc so it no longer describes the old rolling-recap path.

Part of #4469.

Verification

  • RUSTUP_TOOLCHAIN=stable rustfmt --check --edition 2021 src/openhuman/agent/harness/archivist/recap.rs
  • git diff --check
  • rg -n "rolling_segment_recap|rolling recap|rolling-recap|live compaction" src/openhuman/agent/harness/archivist src/openhuman/agent

cargo check --manifest-path Cargo.toml -p openhuman --lib could not complete in the sparse checkout because vendored submodules beyond tinyagents/tinychannels were not fully initialized; it stopped at missing vendor/tinycortex/Cargo.toml.

Summary by CodeRabbit

  • Refactor
    • Streamlined session recap behavior to focus on finalized segments only (recaps for in-progress segments are no longer generated).
    • Updated recap sourcing to prefer archived session data first, with a legacy fallback if needed.
    • Improved recap generation outcomes: returns an AI-generated summary when available, otherwise a heuristic fallback when no suitable output is produced.
  • Tests
    • Adjusted archivist e2e coverage to remove checks for recap being unavailable before flushing an open segment.

@ahfoysal
ahfoysal requested a review from a team July 5, 2026 19:09
@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7a817842-90f9-4fd3-8d2c-300f809f1f65

📥 Commits

Reviewing files that changed from the base of the PR and between ba5a8d5 and 3820f07.

📒 Files selected for processing (1)
  • tests/agent_archivist_debug_round21_raw_coverage_e2e.rs
💤 Files with no reviewable changes (1)
  • tests/agent_archivist_debug_round21_raw_coverage_e2e.rs

📝 Walkthrough

Walkthrough

The rolling_segment_recap public method is removed from ArchivistHook, eliminating open-segment recap behavior. Related documentation and end-to-end assertions are updated for finalize-only segment summarization.

Changes

Recap Module Simplification

Layer / File(s) Summary
Remove rolling recap method and update coverage
src/openhuman/agent/harness/archivist/recap.rs, tests/agent_archivist_debug_round21_raw_coverage_e2e.rs
Removes rolling_segment_recap, updates recap documentation for finalize-only summarization, and deletes pre-flush assertions for the removed method.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

A rabbit hops through code so neat,
Trims the recap, keeps it sweet.
No more rolling, just the close—
One clean path where summary flows.
🐇✂️📜

🚥 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 accurately summarizes the main change: removing the unused rolling recap helper.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

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: ba5a8d5a2e

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

/// Shared summarize helper — the **single LLM summarizer** used by both
/// the finalize path (`on_segment_closed`) and the rolling-recap path
/// (`rolling_segment_recap`).
/// Shared summarize helper used by the finalize path (`on_segment_closed`).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Restore the rolling recap API or update its tests

Deleting rolling_segment_recap leaves integration tests that still call it (tests/agent_archivist_debug_round21_raw_coverage_e2e.rs:321 and :371), so cargo test --test agent_archivist_debug_round21_raw_coverage_e2e will fail to compile with “no method named rolling_segment_recap”. If the helper is truly dead, remove or rewrite those assertions in this same change; otherwise keep the API.

Useful? React with 👍 / 👎.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 5, 2026
@ahfoysal

ahfoysal commented Jul 5, 2026

Copy link
Copy Markdown
Author

Thanks for taking the time to review. I kept this PR tightly scoped to removing the unused rolling recap path and the matching docs updates only.

I couldn’t include a full local compile on this environment yet because a few vendor dependencies weren’t available in the sparse checkout. Happy to adjust if anything else looks odd on your side.

@senamakel

Copy link
Copy Markdown
Member

Thanks for taking the time to review. I kept this PR tightly scoped to removing the unused rolling recap path and the matching docs updates only.

I couldn’t include a full local compile on this environment yet because a few vendor dependencies weren’t available in the sparse checkout. Happy to adjust if anything else looks odd on your side.

Really aweosme to see your contributions. Can you do a git check out, and then check out the submodules. It should all be up-to-date. Do try and let me know?

@ahfoysal

ahfoysal commented Jul 5, 2026

Copy link
Copy Markdown
Author

Thanks for the review, and good call. You’re absolutely right that this is environment-related, not a code-path regression.

I couldn’t run cargo check in that sandbox because this environment was a sparse checkout and some vendored components are missing (notably vendor/tinycortex). I’ll treat this as a hard verification blocker until I complete a full checkout + submodules.

Strict check rule I’m applying now:

  • Full git checkout: git fetch + git checkout this branch
  • Initialize all submodules: git submodule update --init --recursive
  • Run exactly these commands in CI-equivalent order:
    1. RUSTUP_TOOLCHAIN=stable rustfmt --check --edition 2021 src/openhuman/agent/harness/archivist/recap.rs
    2. git diff --check
    3. rg -n "rolling_segment_recap|rolling recap|rolling-recap|live compaction" src/openhuman/agent/harness/archivist src/openhuman/agent
    4. cargo check --manifest-path Cargo.toml -p openhuman --lib

I’ll report back with command output and only request merge once all four complete cleanly.

@ahfoysal

ahfoysal commented Jul 6, 2026

Copy link
Copy Markdown
Author

Thanks for the nudge. I did the full checkout this time and initialized the recursive submodules.

Checked locally on this branch:

git submodule update --init --recursive
RUSTUP_TOOLCHAIN=stable rustfmt --check --edition 2021 src/openhuman/agent/harness/archivist/recap.rs
git diff --check
rg -n "rolling_segment_recap|rolling recap|rolling-recap|live compaction" src/openhuman/agent/harness/archivist src/openhuman/agent
cargo check --manifest-path Cargo.toml -p openhuman --lib

Results:

  • rustfmt passed
  • diff whitespace check passed
  • the rolling recap search returned no matches
  • cargo check passed after installing the missing local cmake dependency required by whisper-rs-sys

The checkout is clean now, and the GitHub checks are green as well.

@M3gA-Mind M3gA-Mind left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

PR #4572 — Remove dead rolling recap helper

Walkthrough

This PR removes the pub async fn rolling_segment_recap method from ArchivistHook and trims the surrounding rustdoc so the module describes only the finalize (on_segment_closed) summarization path. The change is well-scoped and the prose deletions are accurate. However, the "unused" premise does not fully hold: the method is still referenced by the archivist integration tests, so removing it breaks the build.

Changes

File Summary
src/openhuman/agent/harness/archivist/recap.rs Removes rolling_segment_recap and updates module/helper/stub rustdoc to finalize-only wording.

Actionable comments (1)

🛑 Blockers

1. tests/agent_archivist_debug_round21_raw_coverage_e2e.rs:321,371 — deleted method is still called by tests → build break

rolling_segment_recap is not actually unused: the archivist integration test still invokes it in two places:

  • L321: assert_eq!(hook.rolling_segment_recap(session).await, None);
  • L371: assert_eq!(enabled.rolling_segment_recap("missing-session").await, None);

With the method gone, this test crate fails to compile (no method named rolling_segment_recap found for struct ArchivistHook), so cargo test / the Rust CI lane will go red. This is precisely the gap the author flagged — cargo check could not run in the sparse checkout, so the compile break went unseen. rg -n rolling_segment_recap across the repo (not just src/) surfaces both call sites.

Suggested change — delete the two now-dead assertions along with the method. In archivist_flush_finalizes_open_segment_and_extracts_profile_events:

    let open_before = segments::open_segment_for_session(&conn, session)?;
    assert!(open_before.is_some());
-    assert_eq!(hook.rolling_segment_recap(session).await, None);

    hook.flush_open_segment(session).await;

And in archivist_disabled_and_unknown_session_paths_are_noops:

    let enabled = ArchivistHook::new(conn, true);
    enabled.flush_open_segment("missing-session").await;
-    assert_eq!(enabled.rolling_segment_recap("missing-session").await, None);
    Ok(())

If any of that test's intent (verifying the open-segment/no-recap behavior) is still worth keeping, replace the assertion with an equivalent check against the surviving API rather than silently dropping coverage. Please run cargo test --test agent_archivist_debug_round21_raw_coverage_e2e (or the full pnpm test:rust) once submodules are initialized to confirm green before merge.

Nitpicks (1)

  • src/openhuman/agent/harness/archivist/recap.rs:54-70 — after the edit, the summarize_entries rustdoc now carries two topic sentences: the new L54 "Shared summarize helper used by the finalize path…" and the pre-existing L65 "Summarize a set of episodic entries into a recap string." Consider folding them into a single opening line so the doc summary isn't doubled. Not introduced-by-this-PR strictly, but this is the moment it becomes visible.

Questions for the author (0)

None.

Verified / looks good

  • The rustdoc deletions (module header, "single LLM summarizer" note, rolling-recap caveat about live compaction) are all accurate now that the rolling path is gone; no stale references remain in the module.
  • No non-test callers of rolling_segment_recap exist anywhere in src/ or app/ — the only remaining references are the two test assertions above.
  • summarize_entries and read_session_entries are untouched in behavior; the finalize path is unaffected.

Review only — leaving this as a comment, not an approval. The build-breaking test references should be resolved before a maintainer merges.

@@ -177,122 +172,4 @@ impl ArchivistHook {
}
(segments::fallback_summary(first, last, turn_count), false)
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Blocker: build break. Removing rolling_segment_recap leaves two dangling callers in tests/agent_archivist_debug_round21_raw_coverage_e2e.rs (L321 and L371), both assert_eq!(...rolling_segment_recap(...).await, None). cargo test will fail to compile the archivist e2e test crate.

Delete those two assertions along with the method (or port them to a surviving API), then run cargo test --test agent_archivist_debug_round21_raw_coverage_e2e once submodules are initialized to confirm green. A repo-wide rg -n rolling_segment_recap (not scoped to src/) surfaces both call sites.

@M3gA-Mind

Copy link
Copy Markdown
Collaborator

@senamakel @ahfoysal — following up on the "run it once submodules are initialized" thread: doing that check actually matters here, because the "unused" premise doesn't fully hold.\n\nrolling_segment_recap is still called by the archivist integration test in two places:\n- tests/agent_archivist_debug_round21_raw_coverage_e2e.rs:321assert_eq!(hook.rolling_segment_recap(session).await, None);\n- tests/agent_archivist_debug_round21_raw_coverage_e2e.rs:371assert_eq!(enabled.rolling_segment_recap("missing-session").await, None);\n\nSo with the method removed, that test crate no longer compiles and cargo test / the Rust CI lane will fail. A repo-wide rg -n rolling_segment_recap (not scoped to src/) surfaces both. The fix is to drop those two assertions (or port them to a surviving API) as part of this PR, then confirm with cargo test --test agent_archivist_debug_round21_raw_coverage_e2e.\n\nEverything else in the diff looks correct — the rustdoc deletions are accurate and there are no non-test callers. Leaving this as a review comment, not an approval.

@ahfoysal

Copy link
Copy Markdown
Author

Thanks for catching that. I removed the two stale assertions that still referenced rolling_segment_recap after the method was deleted.

Validation:

  • cargo test --test agent_archivist_debug_round21_raw_coverage_e2e

All 5 tests in that file pass locally.

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.

3 participants