refactor(session): retire agent session presenter#1964
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughThe PR retires ChangesSession presenter retirement
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
scripts/architecture-guard.mjs (1)
1560-1582: 🚀 Performance & Scalability | 🟡 Minor | ⚡ Quick winAvoid parsing each main source file twice
sourceFileForAst(source, filePath)always callsts.createSourceFile, so the AST is rebuilt once for the retired-facade scan and again forimportRecordson everyisMainSourcefile. Hoist the parsedsourceFileand reuse it in both branches to cut the extra work.🤖 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 `@scripts/architecture-guard.mjs` around lines 1560 - 1582, Avoid rebuilding the AST in the file loop by creating one sourceFile with sourceFileForAst for each file before the retired-facade and isMainSource checks. Reuse that parsed sourceFile for both findIdentifierNames and the importRecords logic, while preserving the existing branch behavior for non-main files.
🤖 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/main/presenter/index.ts`:
- Around line 961-966: Initialize HooksNotificationsService only once, rather
than reassigning this.hooksNotifications in the projection update path. Ensure
its getSession and getMessage dependencies lazily read from
this.sessionProjectionCoordinator so newSessionHooksBridge continues using the
current projection callbacks.
---
Outside diff comments:
In `@scripts/architecture-guard.mjs`:
- Around line 1560-1582: Avoid rebuilding the AST in the file loop by creating
one sourceFile with sourceFileForAst for each file before the retired-facade and
isMainSource checks. Reuse that parsed sourceFile for both findIdentifierNames
and the importRecords logic, while preserving the existing branch behavior for
non-main files.
🪄 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: cbca39fd-e2bd-4987-9f5b-6dfd8e74a34f
📒 Files selected for processing (44)
docs/architecture/agent-memory-system/spec.mddocs/architecture/agent-system-layered-runtime/README.mddocs/architecture/agent-system-layered-runtime/modules/shared-data-and-io.mddocs/architecture/agent-system.mddocs/architecture/baselines/agent-system-layered-runtime-baseline.jsondocs/architecture/baselines/archive-reference-report.mddocs/architecture/baselines/dependency-report.mddocs/architecture/baselines/main-kernel-boundary-baseline.mddocs/architecture/baselines/main-kernel-migration-scoreboard.jsondocs/architecture/baselines/main-kernel-migration-scoreboard.mddocs/architecture/baselines/zero-inbound-candidates.mddocs/architecture/deepchat-vs-acp-agents/spec.mddocs/architecture/event-system.mddocs/architecture/history-read-hot-path/spec.mddocs/architecture/retire-agent-session-presenter/plan.mddocs/architecture/retire-agent-session-presenter/spec.mddocs/architecture/retire-agent-session-presenter/tasks.mddocs/architecture/session-application-coordinators/plan.mddocs/architecture/session-application-coordinators/spec.mddocs/architecture/session-application-coordinators/tasks.mddocs/architecture/session-boundary-cleanup/spec.mddocs/architecture/session-management.mddocs/architecture/tool-system.mdscripts/agent-cleanup-guard.mjsscripts/architecture-guard.mjsscripts/generate-architecture-baseline.mjssrc/main/presenter/agentSessionPresenter/index.tssrc/main/presenter/floatingButtonPresenter/index.tssrc/main/presenter/index.tssrc/main/presenter/mcpPresenter/inMemoryServers/conversationSearchServer.tssrc/main/presenter/mcpPresenter/toolManager.tssrc/main/routes/index.tssrc/shared/types/presenters/agent-session.presenter.d.tssrc/shared/types/presenters/core.presenter.d.tssrc/shared/types/presenters/index.d.tstest/main/presenter/floatingButtonPresenter/index.test.tstest/main/presenter/mcpPresenter/toolManager.test.tstest/main/presenter/presenterCallErrorHandler.test.tstest/main/presenter/sessionApplication/assignmentCoordinatorFixture.tstest/main/presenter/sessionApplication/projectionCoordinatorFixture.tstest/main/presenter/sessionApplication/runtimeIntegration.test.tstest/main/presenter/sessionApplication/sessionApplication.integration.test.tstest/main/routes/dispatcher.test.tstest/main/scripts/architectureGuard.test.ts
💤 Files with no reviewable changes (5)
- src/main/presenter/agentSessionPresenter/index.ts
- src/shared/types/presenters/agent-session.presenter.d.ts
- src/shared/types/presenters/index.d.ts
- scripts/agent-cleanup-guard.mjs
- src/shared/types/presenters/core.presenter.d.ts
Summary
AgentSessionPresenterand main-processIAgentSessionPresentercontract.Why
The compatibility facade owned no behavior but exposed the four session capability groups as one aggregate dependency. Removing it makes the existing coordinator ownership explicit and prevents callers from coupling to a replacement session facade.
Impact
Route names, IPC contracts, preload APIs, renderer clients, persistence behavior, and runtime semantics remain unchanged. Main-process consumers now depend on the coordinator capability they use.
Validation
pnpm run formatpnpm run format:checkpnpm run i18npnpm run lintpnpm run typecheckpnpm run test:main— 4108 passed, 198 skippedpnpm run test:renderer— 1257 passedSummary by CodeRabbit
Documentation
New Features
Tests