Repository navigation
feat(daemon): serve per-project artifacts over the AG-UI binding - #1416
Merged
Merged
Conversation
The daemon answered the extension's /artifacts/ requests with a 404, so panel images the agent generated never rendered. The binding's mux now serves optional extra routes and hosts a read-only /artifacts/<project-slug>/<relative-path> handler that resolves into that project's artifacts dir, rejecting non-local slugs and paths with filepath.IsLocal. Resolves #1414
inference-gateway-maintainer
Bot
marked this pull request as ready for review
September 29, 2026 23:29
inference-gateway-maintainer
Bot
requested a review
from a team
as a code owner
September 29, 2026 23:29
4 tasks
Contributor
|
🎉 This PR is included in version 0.219.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #1414
Summary
The infer daemon now serves
GET /artifacts/<project-slug>/<relative-path>read-only from~/.infer/projects/<project-slug>/artifacts/, so the opentask extension can render the images the agent generated through the binding it already connects to. The route rides the binding's loopback listener, is unauthenticated like the oldinfer chatroute (an<img>tag cannot send the token), and rejects any slug or relative path that does not stay inside the per-project artifacts subtree (filepath.IsLocal).docs/browser-extension-protocol.mddocuments the route again instead of the 404 note.Changes
internal/protocols/agui:BindingConfig.Routesregisters optional non-WebSocket HTTP handlers next to/wsunder the same loopback listener, and the agui README records the extension point with its closed-import list unchanged.cmd/daemon: a newartifactsHandlerserves files from~/.infer/projects/<slug>/artifacts/forGETandHEAD; other methods answer 405, and a slug that is not a single local path segment, a climb out of the artifacts subtree, a missing file or a directory answers 404 without reading anything.cmd/daemon:startBindingregisters the/artifacts/route on the binding, so the daemon hosts it for every project it serves.cmd/daemon/artifacts_test.go: serving a file from a project's artifacts dir (bytes and content type) and rejecting traversal attempts, with decoy files proving nothing outside the subtree leaks, plus no-slug, missing-file, directory and method cases.internal/protocols/agui/binding_test.go: a registered route is served by a real binding on a random port and unregistered paths still 404.docs/browser-extension-protocol.md: the Artifacts section documentsGET /artifacts/<project-slug>/<relative-path>, its bounds and its unauthenticated-loopback posture, replacing the note that it answers 404.Cross-repo
src/lib/markdown.tsxmust rewrite/.infer/projects/<project-slug>/artifacts/<relative-path>onto the route, the current rewriting only matches/.infer/artifacts/<...>and misses the per-project layoutImageGenerationwrites to. Tracked in [FEATURE] Rewrite per-project artifact images onto the daemon's /artifacts/ route in the opentask extension #1415 since this token has no write access to that repo.Verification
task precommit:run(go mod tidy, go fmt + golangci-lint fmt, import-alias check,golangci-lint run --build-tags purego, markdownlint): clean, 0 issues.go test ./cmd/daemon ./internal/protocols/agui: pass.