Repository navigation
fix(server): wait for command plugins before listing - #850
agenteinstinct1-max wants to merge 3 commits into
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
| } finally { | ||
| readyWaiterController.abort() | ||
| await readyWaiter.catch(() => {}) | ||
| await Effect.runPromise(Deferred.succeed(readyGate, undefined).pipe(Effect.ignore)).catch(() => {}) |
There was a problem hiding this comment.
SUGGESTION: Redundant cleanup - readyGate already succeeded on line 122
This line attempts to succeed an already-succeeded Deferred, which will fail but is caught and ignored. Since readyGate was already succeeded at line 122, this cleanup is unnecessary.
| await Effect.runPromise(Deferred.succeed(readyGate, undefined).pipe(Effect.ignore)).catch(() => {}) | |
| await readyWaiter.catch(() => {}) | |
| if (responsePromise) await responsePromise.catch(() => {}) | |
| await web.dispose() |
| readyWaiterController.abort() | ||
| await readyWaiter.catch(() => {}) | ||
| await Effect.runPromise(Deferred.succeed(readyGate, undefined).pipe(Effect.ignore)).catch(() => {}) | ||
| if (responsePromise) await responsePromise.catch(() => {}) |
There was a problem hiding this comment.
SUGGESTION: Redundant cleanup - responsePromise already awaited on line 123
The response promise was already awaited at line 123 (const response = await responsePromise), so catching it again here is unnecessary.
| if (responsePromise) await responsePromise.catch(() => {}) | |
| await readyWaiter.catch(() => {}) | |
| await web.dispose() |
|
|
||
| const commandService = CommandV2.Service.of({ | ||
| get: (name: string) => Effect.succeed(commands.find((command) => command.name === name)), | ||
| list: () => |
There was a problem hiding this comment.
SUGGESTION: Consider using Effect.fail instead of throwing in Effect.sync
Throwing inside Effect.sync works but converts to an Effect failure. Using Effect.fail would be more idiomatic and allow proper error handling in the Effect pipeline.
| list: () => | |
| list: () => | |
| Effect.gen(function* () { | |
| if (!readyCompleted) yield* Effect.fail(new Error("command.list entered before PluginInternal.ready completed")) | |
| listCalled = true | |
| return commands | |
| }), |
Code Review SummaryStatus: 3 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (2 files)
Fix these issues in Kilo Cloud Reviewed by free · Input: 84K · Output: 6.9K · Cached: 517.3K |
Issue for this PR
Closes #849. Refs #826. This addresses only the command-list readiness ordering requirement, not every CI failure or general completion of #826. The Development sidebar also links the narrow ordering issue #849.
Type of change
What does this PR do?
Awaits
PluginInternal.readyin the mounted command-list HTTP handler before callingCommandV2.list(). Adds a controlled HTTP regression test that holds readiness, verifies no early list call, then releases readiness and checks the 200 response and command names.This is a two-file split from work still present in #836. Its server handler and HTTP test blobs are byte-identical to the independently reviewed server files at
047f7271. The original Arena full-four-file review and current-base dependency qualification were accepted before this split. This is carried review evidence, not a claim that a new reviewer read this commit. Fresh exact-head CI and typecheck are required before merge. #836 and #838 remain open for their other work; no source is removed from them by this publication.How did you verify your code works?
PluginInternalandCommandV2services behind the real mounted HTTP route. It is not a natural CI reproduction, nor proof that every Linux unit: e2e-command-bridge factory/configured command list unexpectedly empty #826 failure has the same cause.Screenshots / recordings
Not applicable: server ordering and regression test only, no UI change.
Checklist