Repository navigation
Conversation
|
Important Review skippedWe couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting You can disable this status message by setting the Use the checkbox below for a quick retry:
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the
Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
Walkthrough
🚥 Pre-merge checks | ✅ 3 | ❌ 2
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (3)
src/renderer/src/lib/automation-agent-session-attribution.test.ts (1)
32-58: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd coverage for the two unbound-tracker orderings.
Neither case is exercised: (a) a nested session emitting the first live status binds as primary, and (b) a fingerprinted
donearriving before any live status returnstrue. Both are the behaviors flagged inautomation-agent-session-attribution.ts; pinning them in tests will make the intended semantics explicit either way.src/renderer/src/hooks/useAutomationDispatchEvents.ts (1)
556-576: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExtract the duplicated OSC status-attribution handler. Both callbacks implement the same four steps — note non-
donestate, bail when a fingerprint is bound, gatedonethrough the tracker, then updatelatestAssistantMessageand finalize — differing only byrequireWorkingAfterStart. Keeping two copies means future attribution fixes must land twice.
src/renderer/src/hooks/useAutomationDispatchEvents.ts#L556-L576: replace the inline fresh-launch handler with a call to a sharedhandleOscAgentStatus(payload)helper defined once in this scope, passing norequireWorkingAfterStart.src/renderer/src/hooks/useAutomationDispatchEvents.ts#L466-L494: replacehandleReusableAgentStatuswith the same shared helper, passingrequireWorkingAfterStart: true.src/renderer/src/hooks/useAutomationDispatchEvents.test.ts (1)
781-832: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winNo coverage for the OSC (
onAgentStatus) reuse path.
observeExistingAutomationSessionis mocked to a bare no-op, sohandleReusableAgentStatus— the branch that preserves paneKey-only completion when no provider session exists, and suppresses OSCdoneonce a session is bound — is never exercised. Capturing the mock'sonAgentStatuscallback and driving it would cover the fallback the PR explicitly preserves.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 3fc29781-8ad5-4141-8f52-57338b9ef908
📥 Commits
Reviewing files that changed from the base of the PR and between 0404f27 and 5613cec874c01f85b26877c1e49f41526f637d3c.
📒 Files selected for processing (4)
src/renderer/src/hooks/useAutomationDispatchEvents.test.tssrc/renderer/src/hooks/useAutomationDispatchEvents.tssrc/renderer/src/lib/automation-agent-session-attribution.test.tssrc/renderer/src/lib/automation-agent-session-attribution.ts
Sync update (
|
d6ba053 to
51f454c
Compare
Sync update (
|
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
Thanks for the focused fix. One downstream interface gap appears to remain. Because this PR intentionally preserves paneKey/time fallback when a provider session is unavailable, an external verifier needs AutomationRun JSON to expose which attribution path was used. Could the run persist and return:
Fallback may still be used internally for compatibility, but it should not be indistinguishable from a positive exact-attribution receipt. Completion, Is that persisted receipt/provenance part of #11158, or would it require a follow-up change? |
51f454c to
c1d556d
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
Addressed the exact-attribution receipt requested on #10999.
Validation: focused attribution/dispatch/retention tests 52 passed after rebase onto current upstream/main. |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
src/renderer/src/hooks/useAutomationDispatchEvents.completion.test.ts (1)
702-706: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert the attribution receipt in the reuse-session test.
The test name states attribution by primary provider session, but the assertion checks only
status: 'completed'. It passes even if the run persistspane_time_fallback. Add the attribution fields, as the fresh-launch test does at lines 644-653.♻️ Proposed test assertion
await vi.waitFor(() => expect(mockMarkDispatchResult).toHaveBeenCalledWith( - expect.objectContaining({ status: 'completed' }) + expect.objectContaining({ + status: 'completed', + completionAttribution: expect.objectContaining({ + kind: 'exact_provider_session', + providerSessionId: 'reuse-primary' + }) + }) ) )
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 8de72693-d2a1-43d1-bb72-111260b587ae
📥 Commits
Reviewing files that changed from the base of the PR and between b115f8d and c1d556dfcf6b18dc91ffdb442c0f4242ebb8aef9.
📒 Files selected for processing (18)
src/main/persistence.test.tssrc/main/persistence.tssrc/renderer/src/components/automations/AutomationListLocalRows.test.tsxsrc/renderer/src/components/automations/automation-list-last-run.test.tssrc/renderer/src/components/automations/automation-list-view.test.tssrc/renderer/src/components/automations/automation-run-completion-evidence.test.tssrc/renderer/src/components/automations/automation-run-open-target.test.tssrc/renderer/src/components/automations/automation-run-view-state.test.tssrc/renderer/src/components/automations/automation-usage-model.test.tssrc/renderer/src/hooks/useAutomationDispatchEvents.completion.test.tssrc/renderer/src/hooks/useAutomationDispatchEvents.test.tssrc/renderer/src/hooks/useAutomationDispatchEvents.tssrc/renderer/src/lib/automation-agent-session-attribution.test.tssrc/renderer/src/lib/automation-agent-session-attribution.tssrc/renderer/src/lib/automation-session-reuse.test.tssrc/shared/automation-run-completion-attribution.tssrc/shared/automation-run-retention.test.tssrc/shared/automations-types.ts
c1d556d to
d73ffcd
Compare
Sync update (
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: fa9be2a7-0ce6-4d98-a4e7-8117ca399608
📥 Commits
Reviewing files that changed from the base of the PR and between c1d556dfcf6b18dc91ffdb442c0f4242ebb8aef9 and d73ffcd7b0f61d8252afb7baa68d67f66702a121.
📒 Files selected for processing (4)
src/renderer/src/hooks/useAutomationDispatchEvents.completion.test.tssrc/renderer/src/hooks/useAutomationDispatchEvents.tssrc/renderer/src/lib/automation-agent-session-attribution.test.tssrc/renderer/src/lib/automation-agent-session-attribution.ts
🚧 Files skipped from review as they are similar to previous changes (3)
- src/renderer/src/lib/automation-agent-session-attribution.test.ts
- src/renderer/src/hooks/useAutomationDispatchEvents.ts
- src/renderer/src/lib/automation-agent-session-attribution.ts
d73ffcd to
40e543b
Compare
Address CodeRabbit on stablyai#11158: - Reset agentStatusByPaneKey early in beforeEach (leftover done can flake) - Bind fingerprint only from working, never from done alone - Ignore fingerprint-bearing done before any primary working bind Full launcher-identity bind (session id from launchAgentBackgroundSession) is deferred; this is the minimal guard without redesigning the launch API.
Address CodeRabbit on stablyai#11158: authorize exact receipts only from a matching done, bind provider sessions from live working samples only, and treat blocked/waiting as non-working for reuse. Preserves: pane/time fallback completion and historical working-edge recovery for recreated reuse-session entries.
|
Address CodeRabbit: await a microtask after the nested Also rebased onto current main. Persistence receipt coverage now lives in Validation: focused attribution/dispatch/persistence tests 70 passed. |
Address CodeRabbit on stablyai#11158: - Reset agentStatusByPaneKey early in beforeEach (leftover done can flake) - Bind fingerprint only from working, never from done alone - Ignore fingerprint-bearing done before any primary working bind Full launcher-identity bind (session id from launchAgentBackgroundSession) is deferred; this is the minimal guard without redesigning the launch API.
Address CodeRabbit on stablyai#11158: authorize exact receipts only from a matching done, bind provider sessions from live working samples only, and treat blocked/waiting as non-working for reuse. Preserves: pane/time fallback completion and historical working-edge recovery for recreated reuse-session entries.
40e543b to
70da04f
Compare
[Medium impact] Adds session tracking to automation run completion logic. The early-finalization defect should be fixed before merging because a nested same-pane session can still win the initial bind and complete the primary automation prematurely. Findings
SummaryThe PR adds provider-session-aware completion attribution for desktop automation runs and persists the resulting completion provenance.
|
| if (identity.state === 'working' && tracker.boundFingerprint === null) { | ||
| tracker.boundFingerprint = fingerprint |
There was a problem hiding this comment.
Nested working session wins binding
When a nested Claude or Codex session publishes working before the primary automation session, this code binds the nested provider fingerprint as the run's identity. The nested session's matching done event then finalizes the automation and can retire its terminal while the primary agent is still running.
Knowledge Base Used: Automation services
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Address CodeRabbit on stablyai#11158: - Reset agentStatusByPaneKey early in beforeEach (leftover done can flake) - Bind fingerprint only from working, never from done alone - Ignore fingerprint-bearing done before any primary working bind Full launcher-identity bind (session id from launchAgentBackgroundSession) is deferred; this is the minimal guard without redesigning the launch API.
Address CodeRabbit on stablyai#11158: authorize exact receipts only from a matching done, bind provider sessions from live working samples only, and treat blocked/waiting as non-working for reuse. Preserves: pane/time fallback completion and historical working-edge recovery for recreated reuse-session entries.
70da04f to
49858e8
Compare
… paneKey Ignore nested same-pane agent status (e.g. SessionStart claude -p) so the automation run waits for the primary agent and is not finalized early. Fixes stablyai#10999
Address CodeRabbit on stablyai#11158: - Reset agentStatusByPaneKey early in beforeEach (leftover done can flake) - Bind fingerprint only from working, never from done alone - Ignore fingerprint-bearing done before any primary working bind Full launcher-identity bind (session id from launchAgentBackgroundSession) is deferred; this is the minimal guard without redesigning the launch API.
Expose a machine-verifiable completionAttribution receipt on AutomationRun JSON so nested same-pane sessions cannot satisfy automations runs --json consumers. Pane/time fallback remains, but is distinguishable. Preserves: fallback completion when no provider session is available.
Address CodeRabbit on stablyai#11158: authorize exact receipts only from a matching done, bind provider sessions from live working samples only, and treat blocked/waiting as non-working for reuse. Preserves: pane/time fallback completion and historical working-edge recovery for recreated reuse-session entries.
49858e8 to
2e4e1f7
Compare
Sync update (
|
Description
Automation runs no longer finalize early when a nested same-pane agent (e.g. Claude SessionStart
claude -p) emitsdoneon the same paneKey as the primary automation agent.Focused fix
Preserves
Evidence
pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/lib/automation-agent-session-attribution.test.ts src/renderer/src/hooks/useAutomationDispatchEvents.test.ts→ 26 passedUser-regression-tradeoffs
Fixes #10999