mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-15 12:55:51 +00:00
test: remove brittle review follow-up assumptions
CodeRabbit's second pass found two valid brittleness issues and one suggested callback-reference assertion that would not match production behavior. This keeps the production behavior unchanged: timers still schedule the summarizer closure, tests now assert timer-handle identity, and UDS connection errors use native Error.cause instead of shadowing it. Constraint: Do not manufacture behavior just to satisfy a review hint; assertions must match the real AgentSummary scheduling contract. Rejected: Assert a fresh scheduled callback function | scheduleNext intentionally passes the same runSummary closure each time. Rejected: Store a custom cause field on UdsPeerConnectionError | native Error.cause is available under ESNext/Bun. Confidence: high Scope-risk: narrow Directive: Timer tests should assert returned handle identity for ownership, not incidental numeric values. Tested: bun test src/services/AgentSummary/__tests__/agentSummary.test.ts src/utils/__tests__/udsMessaging.test.ts Tested: bunx tsc --noEmit --pretty false Tested: bun run lint Tested: bun run test:all Tested: bun test --coverage --coverage-reporter lcov --coverage-dir coverage Tested: bun run build Tested: bun run build:vite Not-tested: GitHub-hosted CodeRabbit refresh until pushed.
This commit is contained in:
@@ -38,13 +38,14 @@ export type PeerSession = {
|
||||
|
||||
export class UdsPeerConnectionError extends Error {
|
||||
readonly socketPath: string
|
||||
readonly cause: unknown
|
||||
|
||||
constructor(socketPath: string, cause: unknown) {
|
||||
super(`Failed to connect to peer at ${socketPath}: ${errorMessage(cause)}`)
|
||||
super(
|
||||
`Failed to connect to peer at ${socketPath}: ${errorMessage(cause)}`,
|
||||
{ cause },
|
||||
)
|
||||
this.name = 'UdsPeerConnectionError'
|
||||
this.socketPath = socketPath
|
||||
this.cause = cause
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user