feat(extensions): add review reload requests - #988
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR adds API v18 review-reload controls for extension lifecycle and custom-event handlers. It:
Confidence Score: 4/5The reload behavior appears sound, but the repository’s enforced filename convention must be satisfied before merging. The queueing, generation leasing, result handling, and lifecycle publication are coherently implemented and tested; the only accepted issue is the new camelCase TypeScript filename. Files Needing Attention: src/ui/lib/extensionReviewReload.ts Important Files Changed
Sequence DiagramsequenceDiagram
participant E as Extension handler
participant L as Generation lease
participant H as AppHost reload queue
participant D as Current review descriptor
participant A as Mounted App
E->>L: ctx.review.requestReload()
alt Lease expired
L-->>E: unavailable
else Lease live
L->>H: enqueue/coalesce request
H->>D: Resolve descriptor when work begins
alt Input is not reloadable
H-->>E: unavailable
else Reload fails
H->>A: Soft reload
H-->>E: failed with detail
else Reload commits
H->>A: Soft reload current input
A-->>H: Successor mounted
H->>E: "session_reload(reason="extension")"
H-->>E: ok
end
end
Prompt To Fix All With AI### Issue 1
src/ui/lib/extensionReviewReload.ts:15
**Filename Violates Naming Convention**
The new `extensionReviewReload.ts` file uses camelCase, but the repository’s Oxlint-enforced `unicorn/filename-case` directive requires dash-case for TypeScript files. Rename it to `extension-review-reload.ts` and update its imports. This repository requirement must be satisfied before merging.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "feat(extensions): add review reload requ..." | Re-trigger Greptile |
| }); | ||
|
|
||
| /** Guard one host-owned reload operation behind a review-generation capability lease. */ | ||
| export function createExtensionReviewReloadControls({ |
There was a problem hiding this comment.
Filename Violates Naming Convention
The new extensionReviewReload.ts file uses camelCase, but the repository’s Oxlint-enforced unicorn/filename-case directive requires dash-case for TypeScript files. Rename it to extension-review-reload.ts and update its imports. This repository requirement must be satisfied before merging.
Context Used: guidelines.mdc Cursor rule (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/ui/lib/extensionReviewReload.ts
Line: 15
Comment:
**Filename Violates Naming Convention**
The new `extensionReviewReload.ts` file uses camelCase, but the repository’s Oxlint-enforced `unicorn/filename-case` directive requires dash-case for TypeScript files. Rename it to `extension-review-reload.ts` and update its imports. This repository requirement must be satisfied before merging.
**Context Used:** guidelines.mdc Cursor rule ([source](https://github.com/modem-dev/modem/blob/main/.cursor/rules/guidelines.mdc))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Problem
Extensions backed by external agent or service streams can know when file edits finish, but they cannot await Hunk rebuilding the mounted review unless watch mode happens to observe the write. Dispatching
hunk.app.refreshonly reports command acceptance and hides reload refusal or failure.Solution
ctx.review.requestReload()to lifecycle and custom-event contexts.ok,unavailable, andfailedresults and publish successful reloads withsession_reload.reason === "extension".AppHost: same-generation extension requests coalesce, all reload sources share the existing FIFO coordinator, and the current descriptor is resolved only when queued work begins.This does not expose arbitrary inputs, extension-registry reloads, or remote/session authority.
Verification
bun run format:checkbun run lintbun run typecheckbun run deps:checkbun run check:docsbun run check:packbun run changeset:statusbun run test(2,000 tests, 1,998 passed, 2 skipped)bun run test:integration(144 tests, 143 passed, 1 macOS-only skip)bun run test:tty-smoke(9 passed)--watchTested on Linux. No visual UI change, so visual evidence is not applicable.