fix(selectors): close residual cancellation gaps - #7358
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThe PR consistently propagates selector cancellation through OpenRouter catalog fetching and shared OAuth credential waiters, while preserving shared refresh and mint work. It also prevents provider results completed after cancellation from being sanitized, logged as successful, or returned.
Confidence Score: 5/5The PR appears safe to merge, with cancellation propagated through the affected selector paths without canceling shared credential work. The updated waiters reject canceled callers before request-local credential bookkeeping, affected providers receive the request signal before external work, and late provider results are discarded before sanitization or successful presentation.
|
| Filename | Overview |
|---|---|
| apps/sim/lib/selectors/application/execute-selector.ts | Propagates the request signal into credential resolution and rejects provider results that arrive after cancellation. |
| apps/sim/lib/selectors/server/credentials.ts | Adds an abortable request-local waiter around shared OAuth credential work without canceling the shared producer. |
| apps/sim/lib/selectors/server/providers/credential-bundle.ts | Applies the same abortable-wait behavior to credential bundle resolution while preserving cancellation errors. |
| apps/sim/lib/selectors/server/internal.ts | Passes the selector signal into the signal-aware OpenRouter embedding catalog fetch. |
| apps/sim/lib/selectors/server/types.ts | Extends authorized selector credentials with the request-local cancellation signal consumed by credential helpers. |
Sequence Diagram
sequenceDiagram
participant R as Selector request
participant E as Selector executor
participant W as Credential waiter
participant S as Shared credential work
participant P as Provider
R->>E: Execute with AbortSignal
E->>W: Resolve credential with signal
W->>S: Start or join shared resolution
alt Request aborts while waiting
R-->>W: Abort
W-->>E: Reject waiter with abort reason
Note over S: Shared work continues independently
else Credential resolves
S-->>W: Token or bundle
W-->>E: Credential result
E->>P: Execute with signal
P-->>E: Provider result
E->>E: throwIfAborted()
E-->>R: Sanitized result
end
Reviews (1): Last reviewed commit: "fix(selectors): close residual cancellat..." | Re-trigger Greptile
There was a problem hiding this comment.
All reported issues were addressed across 9 files
Heads up: you’re close to your included review allowance. Set a flex budget so reviews don’t pause.
Fix all with cubic | Re-trigger cubic
There was a problem hiding this comment.
No issues found across 9 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Heads up: you’re close to your included review allowance. Set a flex budget so reviews don’t pause.
Re-trigger cubic
Summary
Intentional behavior
Shared local and Redis refresh coordination, token caches, credential-row updates, and refresh or mint producers remain unchanged. If one or every selector waiter disconnects, shared work may finish and persist refreshed credentials for other workflows, webhooks, or future requests.
This is a resource-efficiency change only. It does not alter authorization, selector response contracts, protected-value handling, workflow configuration, or credential storage semantics.
Test plan