Skip to content

feat: add HasRecording method to Recorder and update RunInteractive t… - #6

Merged
cnjack merged 1 commit into
mainfrom
feat/skip-empty-conversation
Apr 15, 2026
Merged

feat: add HasRecording method to Recorder and update RunInteractive t…#6
cnjack merged 1 commit into
mainfrom
feat/skip-empty-conversation

Conversation

@cnjack

@cnjack cnjack commented Apr 15, 2026

Copy link
Copy Markdown
Owner

…o check for recordings

Summary by CodeRabbit

  • Bug Fixes
    • Session summary now correctly displays the resume command only when an active recording session exists, preventing misleading suggestions for sessions with no recording activity.

@coderabbitai

coderabbitai Bot commented Apr 15, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

This change adds a HasRecording() method to check whether a recorder has an active recording file, and updates the session-resume command printing logic to only display when both a recorder exists and an active recording is present.

Changes

Cohort / File(s) Summary
Recording Status Check
internal/session/session.go, internal/command/interactive.go
Added HasRecording() method to Recorder to check if recording file exists; updated session-resume command printing to only display when recording is active.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 A method born to check if files are there,
We peek inside the recorder with care,
No phantom sessions shall print and deceive,
Only true recordings shall print, I believe! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: adding a HasRecording method to Recorder and updating RunInteractive to use it.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/skip-empty-conversation

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 and usage tips.

@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 the current code and only fix it if needed.

Inline comments:
In `@internal/session/session.go`:
- Around line 130-134: HasRecording() currently checks r.file != nil which
becomes false after Recorder.Close() clears r.file; instead introduce/persist a
boolean field on Recorder (e.g., hasRecording or recordingExists) that is set
true when a recording is created/opened and is not cleared by Close(), update
the recording creation/opening site to set this flag, change HasRecording() to
return that boolean, and ensure Close() only closes/clears r.file but does not
reset the persistent recording flag so downstream callers still get the resume
hint.
🪄 Autofix (Beta)

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

Review profile: CHILL

Plan: Pro

Run ID: e7791acb-e8e6-4541-a5cd-6a8c8d377a14

📥 Commits

Reviewing files that changed from the base of the PR and between 7f707a1 and 07ace8e.

📒 Files selected for processing (2)
  • internal/command/interactive.go
  • internal/session/session.go

Comment thread internal/session/session.go
@cnjack
cnjack merged commit c9155b3 into main Apr 15, 2026
1 check passed
@cnjack
cnjack deleted the feat/skip-empty-conversation branch April 15, 2026 15:33
cnjack added a commit that referenced this pull request Jul 12, 2026
feat: add HasRecording method to Recorder and update RunInteractive t…
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.

1 participant