Skip to content

fix: 0.15.0-RC polish round two — error details & lookback default#500

Merged
pedramamini merged 6 commits into
mainfrom
0.15.0-RC-polish-round-two
Mar 3, 2026
Merged

fix: 0.15.0-RC polish round two — error details & lookback default#500
pedramamini merged 6 commits into
mainfrom
0.15.0-RC-polish-round-two

Conversation

@pedramamini

@pedramamini pedramamini commented Mar 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Historical error Details button: The "Details" button on error messages in chat history was non-functional because it only worked with live agent errors. Now passes the specific AgentError from the log entry through the callback chain, displaying historical errors in a read-only modal (no recovery actions).
  • Director's Notes lookback default: The Unified History tab now initializes its lookback period from the Encore Features settings default instead of defaulting to "All time".

Test plan

  • Added test for historical error handling in useModalHandlers
  • Updated UnifiedHistoryTab tests for settings-based default
  • Verify "Details" button works on historical error messages in chat history
  • Verify Director's Notes lookback initializes from settings

Summary by CodeRabbit

  • New Features

    • Added support for displaying historical agent errors in error modals.
    • Director Notes lookback period now defaults to 7 days (configurable from settings) instead of all-time.
  • Improvements

    • Enhanced error handling flow to distinguish between live and historical agent errors.
    • Error details from terminal logs now properly pass through to error modals.
  • UI Updates

    • Updated "About Me" label to "Conductor Profile (aka, About Me)" in Settings.

UnifiedHistoryTab was defaulting to "All time" instead of using the
defaultLookbackDays from Encore Features settings. Adds daysToLookbackHours
helper that maps the days setting to the closest LOOKBACK_OPTIONS entry.
The "Details" button on error messages in chat history was non-functional
because it only worked with live agent errors. Now passes the specific
AgentError from the log entry through the callback chain, allowing
historical errors to be displayed in a read-only error modal without
recovery actions.
@coderabbitai

coderabbitai Bot commented Mar 2, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7a83dc0 and 3f10a28.

📒 Files selected for processing (1)
  • src/renderer/App.tsx

📝 Walkthrough

Walkthrough

This PR introduces support for displaying historical agent errors in the modal system while preserving functionality for live errors. It propagates effectiveAgentError through the modal infrastructure and updates error callback signatures across UI components. Additionally, it integrates director notes lookback settings with the history tab.

Changes

Cohort / File(s) Summary
Test Updates
src/__tests__/renderer/components/DirectorNotes/UnifiedHistoryTab.test.tsx, src/__tests__/renderer/hooks/useModalHandlers.test.ts
Extended tests to validate lookback days from settings (defaulting to 7 days) and added new tests for historical agent error modal handling with effectiveAgentError precedence.
Modal Infrastructure
src/renderer/hooks/modal/useModalHandlers.ts, src/renderer/stores/modalStore.ts
Extended useModalHandlers to accept optional AgentError parameter, compute effectiveAgentError from live vs. historical errors, and guard live-only recovery operations. Added historicalError field to AgentErrorModalData and new showHistoricalAgentError action.
Modal Component Propagation
src/renderer/components/AppModals.tsx, src/renderer/App.tsx
Added effectiveAgentError prop to AppModalsProps and AppAgentModalsProps interfaces; updated AgentErrorModal to use effectiveAgentError instead of session-level error. Propagated effectiveAgentError from useModalHandlers through App to AppModals.
UI Component Props
src/renderer/components/MainPanel.tsx, src/renderer/components/TerminalOutput.tsx, src/renderer/hooks/props/useMainPanelProps.ts
Updated onShowAgentErrorModal callback signature to accept optional AgentError; updated onShowErrorDetails to accept AgentError parameter and pass error object to handler. Removed conditional gating of onShowAgentErrorModal in useMainPanelProps.
History Settings Integration
src/renderer/components/DirectorNotes/UnifiedHistoryTab.tsx
Added useSettings hook integration to initialize lookbackHours based on directorNotesSettings.defaultLookbackDays; imported LOOKBACK_OPTIONS for internal mapping.
Minor UI Text
src/renderer/components/SettingsModal.tsx
Updated section header label from "About Me" to "Conductor Profile (aka, About Me)".

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant TerminalOutput
    participant MainPanel
    participant useModalHandlers
    participant modalStore
    participant AppModals
    
    rect rgba(100, 150, 200, 0.5)
    Note over User,AppModals: Agent Error Modal Flow
    User->>TerminalOutput: Click error details button
    TerminalOutput->>useModalHandlers: onShowErrorDetails(agentError)
    useModalHandlers->>useModalHandlers: Compute effectiveAgentError
    useModalHandlers->>modalStore: Dispatch showAgentErrorModal<br/>(with optional historicalError)
    modalStore->>AppModals: Update agentErrorModalData
    AppModals->>AppModals: Receive effectiveAgentError prop
    AppModals->>User: Render AgentErrorModal<br/>(live or historical)
    end
    
    rect rgba(150, 100, 150, 0.5)
    Note over MainPanel,useModalHandlers: Error Banner Alternative Flow
    User->>MainPanel: Click error banner
    MainPanel->>useModalHandlers: onShowAgentErrorModal()
    useModalHandlers->>useModalHandlers: Use live agentError<br/>as effectiveAgentError
    useModalHandlers->>modalStore: Open modal
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

🚥 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 and specifically summarizes the two main changes: historical error details handling and lookback default initialization from settings.
Docstring Coverage ✅ Passed Docstring coverage is 83.33% 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 (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 0.15.0-RC-polish-round-two

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

🧹 Nitpick comments (1)
src/__tests__/renderer/components/DirectorNotes/UnifiedHistoryTab.test.tsx (1)

249-260: Add a regression test for defaultLookbackDays: 0 (“All time”).

Given the all-time encoding uses lookbackDays: 0, add one case with settings mocked to 0 and assert initial fetch uses lookbackDays: 0 and graph receives lookbackHours: null.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/__tests__/renderer/components/DirectorNotes/UnifiedHistoryTab.test.tsx`
around lines 249 - 260, Add a regression test in UnifiedHistoryTab.test.tsx that
mocks settings.defaultLookbackDays to 0 and mounts <UnifiedHistoryTab
theme={mockTheme} />; assert mockGetUnifiedHistory was called with lookbackDays:
0 (and same filter/limit/offset) and also assert the rendered graph/component
received props with lookbackHours: null to verify the "All time" encoding is
passed through; locate references to mockGetUnifiedHistory, defaultLookbackDays,
and the graph component used in UnifiedHistoryTab to implement the mock and
assertions.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/renderer/components/DirectorNotes/UnifiedHistoryTab.tsx`:
- Around line 54-59: The function daysToLookbackHours currently maps days=0 to
the first preset (24h) because it computes targetHours and matches the first
option >= targetHours; update daysToLookbackHours to treat the special boundary
days===0 as “All time” by returning null immediately (so lookbackDays: 0 maps to
null hours), then preserve the existing loop using LOOKBACK_OPTIONS for other
positive day values; reference daysToLookbackHours and LOOKBACK_OPTIONS when
making the change.

In `@src/renderer/hooks/modal/useModalHandlers.ts`:
- Around line 405-419: The modal currently prefers errorSession?.agentError over
historicalAgentError causing a live error to be shown (and recovery actions
enabled) when the user intends to view a historical entry; update the logic so
when the view is a historical entry (isHistorical true) the code uses
historicalAgentError as the effective error and passes the historical
agent/session identifiers into useAgentErrorRecovery so recovery actions remain
disabled. Adjust effectiveError to select historicalAgentError when
isHistorical, and ensure the agentId and sessionId arguments to
useAgentErrorRecovery use the historical values when isHistorical (reference
symbols: effectiveError, isHistorical, useAgentErrorRecovery, errorSession,
historicalAgentError).

---

Nitpick comments:
In `@src/__tests__/renderer/components/DirectorNotes/UnifiedHistoryTab.test.tsx`:
- Around line 249-260: Add a regression test in UnifiedHistoryTab.test.tsx that
mocks settings.defaultLookbackDays to 0 and mounts <UnifiedHistoryTab
theme={mockTheme} />; assert mockGetUnifiedHistory was called with lookbackDays:
0 (and same filter/limit/offset) and also assert the rendered graph/component
received props with lookbackHours: null to verify the "All time" encoding is
passed through; locate references to mockGetUnifiedHistory, defaultLookbackDays,
and the graph component used in UnifiedHistoryTab to implement the mock and
assertions.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 85d0fad and c5b0d8b.

📒 Files selected for processing (10)
  • src/__tests__/renderer/components/DirectorNotes/UnifiedHistoryTab.test.tsx
  • src/__tests__/renderer/hooks/useModalHandlers.test.ts
  • src/renderer/App.tsx
  • src/renderer/components/AppModals.tsx
  • src/renderer/components/DirectorNotes/UnifiedHistoryTab.tsx
  • src/renderer/components/MainPanel.tsx
  • src/renderer/components/TerminalOutput.tsx
  • src/renderer/hooks/modal/useModalHandlers.ts
  • src/renderer/hooks/props/useMainPanelProps.ts
  • src/renderer/stores/modalStore.ts

Comment thread src/renderer/components/DirectorNotes/UnifiedHistoryTab.tsx
Comment on lines +405 to +419
// Determine the effective error: prefer live session error, fall back to historical
const effectiveError = errorSession?.agentError ?? historicalAgentError ?? undefined;
const isHistorical = !errorSession?.agentError && !!historicalAgentError;

// Use the agent error recovery hook to get recovery actions
// Historical errors get no recovery actions (they're read-only)
const { recoveryActions } = useAgentErrorRecovery({
error: errorSession?.agentError,
error: effectiveError,
agentId: errorSession?.toolType || 'claude-code',
sessionId: errorSession?.id || '',
onNewSession: errorSession ? () => handleStartNewSessionAfterError(errorSession.id) : undefined,
onRetry: errorSession ? () => handleRetryAfterError(errorSession.id) : undefined,
onClearError: errorSession ? () => handleClearAgentError(errorSession.id) : undefined,
onRestartAgent: errorSession ? () => handleRestartAgentAfterError(errorSession.id) : undefined,
onAuthenticate: errorSession ? () => handleAuthenticateAfterError(errorSession.id) : undefined,
onNewSession: !isHistorical && errorSession ? () => handleStartNewSessionAfterError(errorSession.id) : undefined,
onRetry: !isHistorical && errorSession ? () => handleRetryAfterError(errorSession.id) : undefined,
onClearError: !isHistorical && errorSession ? () => handleClearAgentError(errorSession.id) : undefined,
onRestartAgent: !isHistorical && errorSession ? () => handleRestartAgentAfterError(errorSession.id) : undefined,
onAuthenticate: !isHistorical && errorSession ? () => handleAuthenticateAfterError(errorSession.id) : undefined,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Historical error can be overridden by live error in the same session.

At Line 406, effectiveError prefers errorSession?.agentError over historicalAgentError. If a live error exists and the user clicks a historical log entry, the modal can show the live error and enable recovery actions (Line 407-419) instead of showing the selected historical error read-only.

💡 Proposed fix
-	// Determine the effective error: prefer live session error, fall back to historical
-	const effectiveError = errorSession?.agentError ?? historicalAgentError ?? undefined;
-	const isHistorical = !errorSession?.agentError && !!historicalAgentError;
+	// Determine the effective error: when a historical entry is selected, it must take precedence
+	const effectiveError = historicalAgentError ?? errorSession?.agentError ?? undefined;
+	const isHistorical = !!historicalAgentError;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// Determine the effective error: prefer live session error, fall back to historical
const effectiveError = errorSession?.agentError ?? historicalAgentError ?? undefined;
const isHistorical = !errorSession?.agentError && !!historicalAgentError;
// Use the agent error recovery hook to get recovery actions
// Historical errors get no recovery actions (they're read-only)
const { recoveryActions } = useAgentErrorRecovery({
error: errorSession?.agentError,
error: effectiveError,
agentId: errorSession?.toolType || 'claude-code',
sessionId: errorSession?.id || '',
onNewSession: errorSession ? () => handleStartNewSessionAfterError(errorSession.id) : undefined,
onRetry: errorSession ? () => handleRetryAfterError(errorSession.id) : undefined,
onClearError: errorSession ? () => handleClearAgentError(errorSession.id) : undefined,
onRestartAgent: errorSession ? () => handleRestartAgentAfterError(errorSession.id) : undefined,
onAuthenticate: errorSession ? () => handleAuthenticateAfterError(errorSession.id) : undefined,
onNewSession: !isHistorical && errorSession ? () => handleStartNewSessionAfterError(errorSession.id) : undefined,
onRetry: !isHistorical && errorSession ? () => handleRetryAfterError(errorSession.id) : undefined,
onClearError: !isHistorical && errorSession ? () => handleClearAgentError(errorSession.id) : undefined,
onRestartAgent: !isHistorical && errorSession ? () => handleRestartAgentAfterError(errorSession.id) : undefined,
onAuthenticate: !isHistorical && errorSession ? () => handleAuthenticateAfterError(errorSession.id) : undefined,
// Determine the effective error: when a historical entry is selected, it must take precedence
const effectiveError = historicalAgentError ?? errorSession?.agentError ?? undefined;
const isHistorical = !!historicalAgentError;
// Use the agent error recovery hook to get recovery actions
// Historical errors get no recovery actions (they're read-only)
const { recoveryActions } = useAgentErrorRecovery({
error: effectiveError,
agentId: errorSession?.toolType || 'claude-code',
sessionId: errorSession?.id || '',
onNewSession: !isHistorical && errorSession ? () => handleStartNewSessionAfterError(errorSession.id) : undefined,
onRetry: !isHistorical && errorSession ? () => handleRetryAfterError(errorSession.id) : undefined,
onClearError: !isHistorical && errorSession ? () => handleClearAgentError(errorSession.id) : undefined,
onRestartAgent: !isHistorical && errorSession ? () => handleRestartAgentAfterError(errorSession.id) : undefined,
onAuthenticate: !isHistorical && errorSession ? () => handleAuthenticateAfterError(errorSession.id) : undefined,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/renderer/hooks/modal/useModalHandlers.ts` around lines 405 - 419, The
modal currently prefers errorSession?.agentError over historicalAgentError
causing a live error to be shown (and recovery actions enabled) when the user
intends to view a historical entry; update the logic so when the view is a
historical entry (isHistorical true) the code uses historicalAgentError as the
effective error and passes the historical agent/session identifiers into
useAgentErrorRecovery so recovery actions remain disabled. Adjust effectiveError
to select historicalAgentError when isHistorical, and ensure the agentId and
sessionId arguments to useAgentErrorRecovery use the historical values when
isHistorical (reference symbols: effectiveError, isHistorical,
useAgentErrorRecovery, errorSession, historicalAgentError).

@greptile-apps

greptile-apps Bot commented Mar 2, 2026

Copy link
Copy Markdown

Greptile Summary

This PR implements two focused bug fixes for the 0.15.0-RC release:

Historical error Details button

  • Enables the "Details" button on error messages in chat history to function properly
  • Previously only worked with live agent errors on the active tab
  • Now passes the specific AgentError from log entries through the callback chain (TerminalOutputMainPanelAppAppModals)
  • Historical errors are displayed in a read-only modal without recovery actions
  • Properly handles missing session context (agentName/sessionName can be undefined for historical errors)

Director's Notes lookback default

  • The Unified History tab now initializes its lookback period from directorNotesSettings.defaultLookbackDays (default: 7 days) instead of "All time"
  • Adds daysToLookbackHours() helper function that finds the smallest LOOKBACK_OPTIONS entry covering the configured days
  • Falls back to "All time" if no option is large enough

Both changes include comprehensive test coverage and maintain backwards compatibility. The implementation is type-safe throughout and properly handles edge cases.

Confidence Score: 5/5

  • This PR is safe to merge with no identified risks
  • Clean, focused bug fixes with proper test coverage and no breaking changes. The implementation properly handles edge cases (historical errors without session context), maintains type safety throughout the callback chain, and includes comprehensive test updates. Both features are well-isolated and don't affect unrelated functionality.
  • No files require special attention

Important Files Changed

Filename Overview
src/renderer/stores/modalStore.ts Added historicalError field to AgentErrorModalData and new showHistoricalAgentError action to support displaying historical errors from chat logs
src/renderer/hooks/modal/useModalHandlers.ts Modified handleShowAgentErrorModal to accept optional AgentError parameter, added effectiveAgentError to return value, and disabled recovery actions for historical errors
src/renderer/components/TerminalOutput.tsx Updated onShowErrorDetails callback signature to pass the specific AgentError from log entries, enabling historical error display
src/renderer/components/DirectorNotes/UnifiedHistoryTab.tsx Added daysToLookbackHours helper function and initialized lookback period from directorNotesSettings.defaultLookbackDays instead of defaulting to "All time"
src/renderer/components/AppModals.tsx Updated AgentErrorModal to use effectiveAgentError (live or historical) instead of only errorSession.agentError, with graceful handling of missing session context

Last reviewed commit: c5b0d8b

- daysToLookbackHours(0) now returns null (All time) instead of
  incorrectly matching the first preset (24h)
- effectiveAgentError now prefers historical error when explicitly
  requested via Details button, preventing live errors from shadowing it

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/__tests__/renderer/components/DirectorNotes/UnifiedHistoryTab.test.tsx (1)

265-278: ⚠️ Potential issue | 🟡 Minor

Move the lookback-hours assertion into waitFor to avoid async test flakiness.

activity-lookback-hours is checked immediately after an async path; this can race render timing in CI.

Suggested test-stability patch
 		await waitFor(() => {
 			expect(mockGetUnifiedHistory).toHaveBeenCalledWith({
 				lookbackDays: 0,
 				filter: null,
 				limit: 100,
 				offset: 0,
 			});
 		});
-		expect(screen.getByTestId('activity-lookback-hours')).toHaveTextContent('null');
+		await waitFor(() => {
+			expect(screen.getByTestId('activity-lookback-hours')).toHaveTextContent('null');
+		});
 	});
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/__tests__/renderer/components/DirectorNotes/UnifiedHistoryTab.test.tsx`
around lines 265 - 278, The assertion that the DOM element with test id
'activity-lookback-hours' contains 'null' is currently outside the async wait
and can race; inside the test 'fetches all-time history when defaultLookbackDays
is 0' (where mockDirNotesSettings.defaultLookbackDays = 0 and
mockGetUnifiedHistory is expected to be called for UnifiedHistoryTab), move the
expect(screen.getByTestId('activity-lookback-hours')).toHaveTextContent('null')
into the existing waitFor block so both the mockGetUnifiedHistory call assertion
and the DOM text assertion run after the component's async render completes.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/__tests__/renderer/components/DirectorNotes/UnifiedHistoryTab.test.tsx`:
- Around line 265-278: The assertion that the DOM element with test id
'activity-lookback-hours' contains 'null' is currently outside the async wait
and can race; inside the test 'fetches all-time history when defaultLookbackDays
is 0' (where mockDirNotesSettings.defaultLookbackDays = 0 and
mockGetUnifiedHistory is expected to be called for UnifiedHistoryTab), move the
expect(screen.getByTestId('activity-lookback-hours')).toHaveTextContent('null')
into the existing waitFor block so both the mockGetUnifiedHistory call assertion
and the DOM text assertion run after the component's async render completes.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c5b0d8b and b379c0b.

📒 Files selected for processing (4)
  • src/__tests__/renderer/components/DirectorNotes/UnifiedHistoryTab.test.tsx
  • src/__tests__/renderer/hooks/useModalHandlers.test.ts
  • src/renderer/components/DirectorNotes/UnifiedHistoryTab.tsx
  • src/renderer/hooks/modal/useModalHandlers.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/tests/renderer/hooks/useModalHandlers.test.ts
  • src/renderer/components/DirectorNotes/UnifiedHistoryTab.tsx

Clarifies the purpose of the profile section by showing both terms.
- Unified History empty-state now reflects selected time range messaging 🕒
- Lookback “All Time” selection correctly maps to `lookbackDays: 0` 🌐
- Unified History tests updated for default 7-day lookback behavior 📅
- TerminalOutput alignment logic clarified: user messages no longer reversed ➡️
- TerminalOutput tests tightened to assert correct container class usage 🧪
Both branches fixed the same user message alignment test; kept main's
version using data-log-index selector for positive assertion.
@pedramamini
pedramamini merged commit 9577819 into main Mar 3, 2026
2 of 3 checks passed

@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.

🧹 Nitpick comments (1)
src/__tests__/renderer/components/DirectorNotes/UnifiedHistoryTab.test.tsx (1)

252-278: Add one non-exact mapping test for lookback default.

Current tests cover exact values (7) and sentinel all-time (0), but not a non-exact default (e.g., defaultLookbackDays = 10) mapping to the nearest LOOKBACK_OPTIONS bucket. Adding this would lock in the helper’s intended behavior and prevent regressions.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/__tests__/renderer/components/DirectorNotes/UnifiedHistoryTab.test.tsx`
around lines 252 - 278, Add a third test that sets
mockDirNotesSettings.defaultLookbackDays = 10, renders <UnifiedHistoryTab
theme={mockTheme} />, computes the expected bucket by picking the nearest value
from LOOKBACK_OPTIONS (import LOOKBACK_OPTIONS in the test and pick the closest
numeric value to 10), then await waitFor and assert mockGetUnifiedHistory was
called with { lookbackDays: expectedBucket, filter: null, limit: 100, offset: 0
}; optionally also assert screen.getByTestId('activity-lookback-hours') displays
the mapped value. This uses UnifiedHistoryTab, mockDirNotesSettings,
mockGetUnifiedHistory and LOOKBACK_OPTIONS to lock in the non-exact mapping
behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/__tests__/renderer/components/DirectorNotes/UnifiedHistoryTab.test.tsx`:
- Around line 252-278: Add a third test that sets
mockDirNotesSettings.defaultLookbackDays = 10, renders <UnifiedHistoryTab
theme={mockTheme} />, computes the expected bucket by picking the nearest value
from LOOKBACK_OPTIONS (import LOOKBACK_OPTIONS in the test and pick the closest
numeric value to 10), then await waitFor and assert mockGetUnifiedHistory was
called with { lookbackDays: expectedBucket, filter: null, limit: 100, offset: 0
}; optionally also assert screen.getByTestId('activity-lookback-hours') displays
the mapped value. This uses UnifiedHistoryTab, mockDirNotesSettings,
mockGetUnifiedHistory and LOOKBACK_OPTIONS to lock in the non-exact mapping
behavior.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b379c0b and 7a83dc0.

📒 Files selected for processing (3)
  • src/__tests__/renderer/components/DirectorNotes/UnifiedHistoryTab.test.tsx
  • src/__tests__/renderer/components/TerminalOutput.test.tsx
  • src/renderer/components/SettingsModal.tsx

@pedramamini pedramamini mentioned this pull request Mar 3, 2026
5 tasks
pedramamini added a commit that referenced this pull request Mar 3, 2026
* fix: initialize Director's Notes lookback from settings default

UnifiedHistoryTab was defaulting to "All time" instead of using the
defaultLookbackDays from Encore Features settings. Adds daysToLookbackHours
helper that maps the days setting to the closest LOOKBACK_OPTIONS entry.

* fix: enable Details button for historical error messages in chat history

The "Details" button on error messages in chat history was non-functional
because it only worked with live agent errors. Now passes the specific
AgentError from the log entry through the callback chain, allowing
historical errors to be displayed in a read-only error modal without
recovery actions.

* fix: address CodeRabbit review findings on PR #500

- daysToLookbackHours(0) now returns null (All time) instead of
  incorrectly matching the first preset (24h)
- effectiveAgentError now prefers historical error when explicitly
  requested via Details button, preventing live errors from shadowing it

* fix: rename About Me heading to Conductor Profile in Settings

Clarifies the purpose of the profile section by showing both terms.

* ## CHANGES

- Unified History empty-state now reflects selected time range messaging 🕒
- Lookback “All Time” selection correctly maps to `lookbackDays: 0` 🌐
- Unified History tests updated for default 7-day lookback behavior 📅
- TerminalOutput alignment logic clarified: user messages no longer reversed ➡️
- TerminalOutput tests tightened to assert correct container class usage 🧪

* fix: clear activeFileTabId when resuming session from history pill

When a file preview tab was active, clicking a session ID pill in the
History panel would set inputMode to 'ai' but leave activeFileTabId
set, causing MainPanel to continue showing the file preview instead of
switching to the AI tab.
reachrazamair added a commit that referenced this pull request Mar 3, 2026
Resolves conflict in SettingsModal.tsx: kept decomposed <GeneralTab>
component (from our refactoring) and ported the "Conductor Profile"
heading rename from PR #500 into GeneralTab.tsx.

Auto-merged changes from main (PRs #499, #500, #503):
- Historical agent error modal support (effectiveAgentError)
- OpenCode parser improvements (filePath tool detail)
- TerminalOutput error details callback signature update
- Director's Notes lookback default initialization
@chr1syy chr1syy mentioned this pull request Mar 4, 2026
4 tasks
pedramamini added a commit that referenced this pull request Mar 5, 2026
)

* fix: initialize Director's Notes lookback from settings default

UnifiedHistoryTab was defaulting to "All time" instead of using the
defaultLookbackDays from Encore Features settings. Adds daysToLookbackHours
helper that maps the days setting to the closest LOOKBACK_OPTIONS entry.

* fix: enable Details button for historical error messages in chat history

The "Details" button on error messages in chat history was non-functional
because it only worked with live agent errors. Now passes the specific
AgentError from the log entry through the callback chain, allowing
historical errors to be displayed in a read-only error modal without
recovery actions.

* fix: address CodeRabbit review findings on PR #500

- daysToLookbackHours(0) now returns null (All time) instead of
  incorrectly matching the first preset (24h)
- effectiveAgentError now prefers historical error when explicitly
  requested via Details button, preventing live errors from shadowing it

* fix: rename About Me heading to Conductor Profile in Settings

Clarifies the purpose of the profile section by showing both terms.

* ## CHANGES

- Unified History empty-state now reflects selected time range messaging 🕒
- Lookback “All Time” selection correctly maps to `lookbackDays: 0` 🌐
- Unified History tests updated for default 7-day lookback behavior 📅
- TerminalOutput alignment logic clarified: user messages no longer reversed ➡️
- TerminalOutput tests tightened to assert correct container class usage 🧪
pedramamini added a commit that referenced this pull request Mar 5, 2026
* fix: initialize Director's Notes lookback from settings default

UnifiedHistoryTab was defaulting to "All time" instead of using the
defaultLookbackDays from Encore Features settings. Adds daysToLookbackHours
helper that maps the days setting to the closest LOOKBACK_OPTIONS entry.

* fix: enable Details button for historical error messages in chat history

The "Details" button on error messages in chat history was non-functional
because it only worked with live agent errors. Now passes the specific
AgentError from the log entry through the callback chain, allowing
historical errors to be displayed in a read-only error modal without
recovery actions.

* fix: address CodeRabbit review findings on PR #500

- daysToLookbackHours(0) now returns null (All time) instead of
  incorrectly matching the first preset (24h)
- effectiveAgentError now prefers historical error when explicitly
  requested via Details button, preventing live errors from shadowing it

* fix: rename About Me heading to Conductor Profile in Settings

Clarifies the purpose of the profile section by showing both terms.

* ## CHANGES

- Unified History empty-state now reflects selected time range messaging 🕒
- Lookback “All Time” selection correctly maps to `lookbackDays: 0` 🌐
- Unified History tests updated for default 7-day lookback behavior 📅
- TerminalOutput alignment logic clarified: user messages no longer reversed ➡️
- TerminalOutput tests tightened to assert correct container class usage 🧪

* fix: clear activeFileTabId when resuming session from history pill

When a file preview tab was active, clicking a session ID pill in the
History panel would set inputMode to 'ai' but leave activeFileTabId
set, causing MainPanel to continue showing the file preview instead of
switching to the AI tab.
pedramamini added a commit that referenced this pull request Mar 9, 2026
)

* fix: initialize Director's Notes lookback from settings default

UnifiedHistoryTab was defaulting to "All time" instead of using the
defaultLookbackDays from Encore Features settings. Adds daysToLookbackHours
helper that maps the days setting to the closest LOOKBACK_OPTIONS entry.

* fix: enable Details button for historical error messages in chat history

The "Details" button on error messages in chat history was non-functional
because it only worked with live agent errors. Now passes the specific
AgentError from the log entry through the callback chain, allowing
historical errors to be displayed in a read-only error modal without
recovery actions.

* fix: address CodeRabbit review findings on PR #500

- daysToLookbackHours(0) now returns null (All time) instead of
  incorrectly matching the first preset (24h)
- effectiveAgentError now prefers historical error when explicitly
  requested via Details button, preventing live errors from shadowing it

* fix: rename About Me heading to Conductor Profile in Settings

Clarifies the purpose of the profile section by showing both terms.

* ## CHANGES

- Unified History empty-state now reflects selected time range messaging 🕒
- Lookback “All Time” selection correctly maps to `lookbackDays: 0` 🌐
- Unified History tests updated for default 7-day lookback behavior 📅
- TerminalOutput alignment logic clarified: user messages no longer reversed ➡️
- TerminalOutput tests tightened to assert correct container class usage 🧪
pedramamini added a commit that referenced this pull request Mar 9, 2026
)

* fix: initialize Director's Notes lookback from settings default

UnifiedHistoryTab was defaulting to "All time" instead of using the
defaultLookbackDays from Encore Features settings. Adds daysToLookbackHours
helper that maps the days setting to the closest LOOKBACK_OPTIONS entry.

* fix: enable Details button for historical error messages in chat history

The "Details" button on error messages in chat history was non-functional
because it only worked with live agent errors. Now passes the specific
AgentError from the log entry through the callback chain, allowing
historical errors to be displayed in a read-only error modal without
recovery actions.

* fix: address CodeRabbit review findings on PR #500

- daysToLookbackHours(0) now returns null (All time) instead of
  incorrectly matching the first preset (24h)
- effectiveAgentError now prefers historical error when explicitly
  requested via Details button, preventing live errors from shadowing it

* fix: rename About Me heading to Conductor Profile in Settings

Clarifies the purpose of the profile section by showing both terms.

* ## CHANGES

- Unified History empty-state now reflects selected time range messaging 🕒
- Lookback “All Time” selection correctly maps to `lookbackDays: 0` 🌐
- Unified History tests updated for default 7-day lookback behavior 📅
- TerminalOutput alignment logic clarified: user messages no longer reversed ➡️
- TerminalOutput tests tightened to assert correct container class usage 🧪
pedramamini added a commit that referenced this pull request Mar 10, 2026
)

* fix: initialize Director's Notes lookback from settings default

UnifiedHistoryTab was defaulting to "All time" instead of using the
defaultLookbackDays from Encore Features settings. Adds daysToLookbackHours
helper that maps the days setting to the closest LOOKBACK_OPTIONS entry.

* fix: enable Details button for historical error messages in chat history

The "Details" button on error messages in chat history was non-functional
because it only worked with live agent errors. Now passes the specific
AgentError from the log entry through the callback chain, allowing
historical errors to be displayed in a read-only error modal without
recovery actions.

* fix: address CodeRabbit review findings on PR #500

- daysToLookbackHours(0) now returns null (All time) instead of
  incorrectly matching the first preset (24h)
- effectiveAgentError now prefers historical error when explicitly
  requested via Details button, preventing live errors from shadowing it

* fix: rename About Me heading to Conductor Profile in Settings

Clarifies the purpose of the profile section by showing both terms.

* ## CHANGES

- Unified History empty-state now reflects selected time range messaging 🕒
- Lookback “All Time” selection correctly maps to `lookbackDays: 0` 🌐
- Unified History tests updated for default 7-day lookback behavior 📅
- TerminalOutput alignment logic clarified: user messages no longer reversed ➡️
- TerminalOutput tests tightened to assert correct container class usage 🧪
pedramamini added a commit that referenced this pull request Mar 11, 2026
)

* fix: initialize Director's Notes lookback from settings default

UnifiedHistoryTab was defaulting to "All time" instead of using the
defaultLookbackDays from Encore Features settings. Adds daysToLookbackHours
helper that maps the days setting to the closest LOOKBACK_OPTIONS entry.

* fix: enable Details button for historical error messages in chat history

The "Details" button on error messages in chat history was non-functional
because it only worked with live agent errors. Now passes the specific
AgentError from the log entry through the callback chain, allowing
historical errors to be displayed in a read-only error modal without
recovery actions.

* fix: address CodeRabbit review findings on PR #500

- daysToLookbackHours(0) now returns null (All time) instead of
  incorrectly matching the first preset (24h)
- effectiveAgentError now prefers historical error when explicitly
  requested via Details button, preventing live errors from shadowing it

* fix: rename About Me heading to Conductor Profile in Settings

Clarifies the purpose of the profile section by showing both terms.

* ## CHANGES

- Unified History empty-state now reflects selected time range messaging 🕒
- Lookback “All Time” selection correctly maps to `lookbackDays: 0` 🌐
- Unified History tests updated for default 7-day lookback behavior 📅
- TerminalOutput alignment logic clarified: user messages no longer reversed ➡️
- TerminalOutput tests tightened to assert correct container class usage 🧪
pedramamini added a commit that referenced this pull request Mar 18, 2026
)

* fix: initialize Director's Notes lookback from settings default

UnifiedHistoryTab was defaulting to "All time" instead of using the
defaultLookbackDays from Encore Features settings. Adds daysToLookbackHours
helper that maps the days setting to the closest LOOKBACK_OPTIONS entry.

* fix: enable Details button for historical error messages in chat history

The "Details" button on error messages in chat history was non-functional
because it only worked with live agent errors. Now passes the specific
AgentError from the log entry through the callback chain, allowing
historical errors to be displayed in a read-only error modal without
recovery actions.

* fix: address CodeRabbit review findings on PR #500

- daysToLookbackHours(0) now returns null (All time) instead of
  incorrectly matching the first preset (24h)
- effectiveAgentError now prefers historical error when explicitly
  requested via Details button, preventing live errors from shadowing it

* fix: rename About Me heading to Conductor Profile in Settings

Clarifies the purpose of the profile section by showing both terms.

* ## CHANGES

- Unified History empty-state now reflects selected time range messaging 🕒
- Lookback “All Time” selection correctly maps to `lookbackDays: 0` 🌐
- Unified History tests updated for default 7-day lookback behavior 📅
- TerminalOutput alignment logic clarified: user messages no longer reversed ➡️
- TerminalOutput tests tightened to assert correct container class usage 🧪
@coderabbitai coderabbitai Bot mentioned this pull request Apr 29, 2026
6 tasks
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