Draft
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| const eventWithPriority = { ...event, priority }; | ||
| const notifierNames = config.notificationRouting[priority] ?? config.defaults.notifiers; | ||
| const notificationPlan = plan ?? resolveNotificationPlan(priority); | ||
| const trackedSession = session ?? (await sessionManager.get(event.sessionId).catch(() => null)); |
There was a problem hiding this comment.
Null session triggers unnecessary sessionManager lookup for system events
Low Severity
When notifyHuman is called with session explicitly set to null (for system-level events like all-complete), the nullish coalescing operator ?? treats null as a trigger for the fallback sessionManager.get(event.sessionId). This causes an unnecessary sessionManager.get("system") call that iterates through all projects' metadata directories on disk. The caller's intent with null is "no session exists," but ?? doesn't distinguish null from undefined.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
/api/ao/*endpoints for status, session listing, session detail, kill, and retry flows/api/sessions*behavior with AO routes for auth handling, correlation-safe error responses, and fallback project normalizationsession serialization indirection
Test Plan
HOME=/tmp pnpm --filter @composio/ao-core test -- src/__tests__/config-validation.test.ts src/__tests__/session-manager.test.tsHOME=/tmp pnpm --filter @composio/ao-core test -- src/__tests__/session-manager.test.tspnpm --filter @composio/ao-core buildpnpm --filter @composio/ao-web test -- src/__tests__/services.test.ts src/__tests__/api-routes.test.ts src/__tests__/api-ao.test.ts src/lib/__tests__/ serialize.test.ts src/lib/__tests__/api-auth.test.tspnpm --filter @composio/ao-core typecheckpnpm --filter @composio/ao-web typecheck