Repository navigation
test: arm owned deadlines before synchronous launch - #836
agenteinstinct1-max wants to merge 13 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. |
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Overview
Files Reviewed (3 files)
Previous WARNING on Previous Review Summaries (9 snapshots, latest commit d6217d7)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit d6217d7)Status: 5 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)CRITICAL
WARNING
SUGGESTION
Files Reviewed (1 file)
Fix these issues in Kilo Cloud Previous review (commit e762471)Status: No Issues Found | Recommendation: Merge Files Reviewed (4 files)
Previous review (commit 047f727)Status: No Issues Found | Recommendation: Merge Files Reviewed (1 files)
Previous review (commit 804abb7)Status: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Previous review (commit 1e83c80)Status: No Issues Found | Recommendation: Merge Files Reviewed (1 files)
Previous review (commit 103817e)This review did not finish. The model reached its output limit before it Previous review (commit 103817e)Status: No Issues Found | Recommendation: Merge Files Reviewed (4 files)
Previous review (commit c704c73)Status: No Issues Found | Recommendation: Merge Files Reviewed (8 files)
Previous review (commit 9a0fca0)Status: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Reviewed by free · Input: 43.8K · Output: 9.9K · Cached: 160.4K |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
| app.renderer.destroy() | ||
| } | ||
|
|
||
| expect(thrown).toEqual(new Error("Timed out waiting for DiffViewerFileTree to mount")) |
There was a problem hiding this comment.
CRITICAL: Test expects specific error message but captureSettledFrame throws different message
The test at line 230 expects "Timed out waiting for DiffViewerFileTree to mount" but captureSettledFrame (called at line 223) throws "Timed out waiting for DiffViewerFileTree frame to settle" when its deadline expires. If the theme discovery never resolves but the component mounts (e.g., ThemeProvider renders children before discovery completes), the timeout would occur in captureSettledFrame and the test would fail with a mismatched error message.
| expect(thrown).toEqual(new Error("Timed out waiting for DiffViewerFileTree to mount")) | |
| expect(thrown instanceof Error).toBe(true) | |
| expect(["Timed out waiting for DiffViewerFileTree to mount", "Timed out waiting for DiffViewerFileTree frame to settle"]).toContain(thrown.message) |
| try { | ||
| await renderOnceSettled(app) | ||
| const lines = visibleLines(await captureFrame(app)) | ||
| const lines = visibleLines(await captureFrameWithin(app, performance.now() + 40 * 25)) |
There was a problem hiding this comment.
WARNING: Deadline set after renderOnceSettled doesn't account for time already spent
The deadline passed to captureFrameWithin is calculated as performance.now() + 40 * 25 (line 56), but this occurs AFTER renderOnceSettled(app) completes. renderOnceSettled performs two renders with a 25ms delay between them, consuming measurable time that isn't accounted for in the capture deadline. This could cause premature timeouts on slower systems.
Consider setting a single deadline at test start and passing it through both renderOnceSettled and captureFrameWithin.
| buildFileTree, | ||
| } from "../../../src/feature-plugins/system/diff-viewer-file-tree-utils" | ||
|
|
||
| const RENDER_BUDGET_MS = 25 + 40 * 25 |
There was a problem hiding this comment.
SUGGESTION: RENDER_BUDGET_MS is a magic number without explanation
const RENDER_BUDGET_MS = 25 + 40 * 25 evaluates to 1025ms but the derivation isn't documented. The components (25ms initial delay + 40 iterations * 25ms) suggest it's related to the render loop timing in captureSettledFrame and waitForFileTreeMount. Adding a comment explaining the calculation would improve maintainability.
| if (remaining <= 0) throw new Error("Timed out waiting for DiffViewerFileTree to mount") | ||
| await new Promise((resolve) => setTimeout(resolve, Math.min(25, remaining))) | ||
| } | ||
| if (!mounted()) throw new Error("Timed out waiting for DiffViewerFileTree to mount") |
There was a problem hiding this comment.
SUGGESTION: Redundant final check in waitForFileTreeMount — loop condition already guarantees mounted is true
The while (!mounted()) loop only exits when mounted() becomes true (either via the break after renderWithin or by throwing on timeout). The final if (!mounted()) throw ... check at line 248 is therefore unreachable and can be removed.
| if (!mounted()) throw new Error("Timed out waiting for DiffViewerFileTree to mount") | |
| } |
| } | ||
|
|
||
| function withTheme(component: () => JSX.Element) { | ||
| function Mounted(props: { onMount?: () => void; children: JSX.Element }) { |
There was a problem hiding this comment.
SUGGESTION: Mounted component has naming collision between onMount prop and SolidJS onMount function
The Mounted component at lines 327-330 uses onMount both as a prop name (props.onMount) and as the SolidJS lifecycle function imported from solid-js. While technically valid due to different scopes, this creates confusing code. Consider renaming the prop to onMountCallback or similar.
| function Mounted(props: { onMount?: () => void; children: JSX.Element }) { | |
| function Mounted(props: { onMountCallback?: () => void; children: JSX.Element }) { | |
| onMount(() => props.onMountCallback?.()) | |
| return props.children | |
| } |
Issue for this PR
Closes #838. Refs #828. This is a narrow correction, not completion of #828 or #442 and not an explanation of the historical #740 CI failure.
Type of change
What does this PR do?
Register the owned deadline before synchronous launch work and clear it when launch throws. Await PluginInternal.ready before listing commands in the HTTP handler. Add a mounted HTTP regression using the real API, production handlers and middleware, and location services, with a controlled readiness gate.
Published head: 047f727, tree 4d665026fe25938a3ce6fe1d0896c291017644f7. This normal integration has parents 804abb7 and base 32c33f4 after #840. All four changed-file blobs are identical to the prior PR head. No timeout, budget, assertion, skip or workflow is relaxed. Synchronous JavaScript is not made preemptible.
How did you verify your code works?
Actual local integrated-tree runs on Bun 1.3.14: command-readiness 1 pass / 5 expectations; owned-deadline 10 pass / 45 expectations. Earlier fix-off controls fail on the removed readiness await and timer ordering. The earlier processor 44/1 result used the wrong default 5000ms invocation and is retracted; the repository's unchanged 30000ms command yielded 45 pass / 325 expectations on the earlier integrated tree. That is not new-head CI proof.
The same independent Arena review inspected the complete four-file patch against the current base and returned CLEAN, with no integration must-fix. It verified unchanged patch-id and blobs and the disjoint #840 base delta: https://arena.ai/agent/01a1c89d-fb30-7ae6-8f25-2dc4247e3a11 . Source review is not runtime qualification.
Fresh exact-047f727 CI is now running after publication. Prior 804 Linux success and Windows diff-viewer failures, and #840's separate green jobs, are not a green claim or causal exoneration for this head. Linux, Windows, typecheck and policy checks must pass before merge. No local compiler success is claimed.
Screenshots / recordings
Not applicable: no UI change.
Checklist