You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE] Serve generated artifacts per project from the infer daemon's AG-UI binding #1414
The opentask extension renders images the agent generated through the binding's /artifacts/ HTTP route, because an MV3 extension cannot load a local file path. Since #1413 only infer daemon hosts the binding, and it builds its ExtensionBridge without an ArtifactsDir. The route is never registered, so every panel image answers 404. infer chat used to serve its own project's artifacts dir, but it no longer binds the port.
One daemon serves threads from many projects, and each project keeps its artifacts under ~/.infer/projects/<project-slug>/artifacts/, so a single ArtifactsDir cannot back the route.
The extension side is out of date as well. src/lib/markdown.tsx in inference-gateway/opentask only rewrites paths matching /.infer/artifacts/<...>, which misses the per-project layout that ImageGeneration writes to.
Proposal
The daemon serves GET /artifacts/<project-slug>/<relative-path> read-only from ~/.infer/projects/<project-slug>/artifacts/<relative-path>, and rejects a slug or path that is not local (filepath.IsLocal).
The extension rewrites /.infer/projects/<project-slug>/artifacts/<path> onto that route.
Acceptance Criteria
infer daemon serves /artifacts/<project-slug>/<path> from that project's artifacts dir, loopback-only, with path traversal rejected
The opentask extension rewrites per-project artifact paths onto the route and renders them inline in the panel
docs/browser-extension-protocol.md documents the route again, replacing the note that it answers 404
Tests cover serving a file from a project's artifacts dir and rejecting a traversal attempt
Cross-repo: needs a matching change in inference-gateway/opentask.
When this lands, the docs site's OpenTask page needs the matching update. inference-gateway/docs#866 tracks the page, which currently says the daemon serves /artifacts/. The CLI's wire contract in docs/browser-extension-protocol.md states that the route answers 404 until then.
All work is complete and pushed. Here is the final summary for the issue:
Summary
PR #1416 (ready for review): #1416 - feat(daemon): serve per-project artifacts over the AG-UI binding
The daemon now serves the artifacts route the opentask extension needs. Since #1413 the binding's mux only registered /ws, so every panel image request answered 404. This lands the per-project design proposed in the issue:
Changes
internal/protocols/agui/binding.go: BindingConfig.Routes registers optional non-WebSocket HTTP handlers next to /ws under the same loopback listener. agui stays general purpose (stdlib-only import, so its closed depguard list is untouched), and the agui README documents the extension point.
cmd/daemon/artifacts.go (new): a read-only handler for GET/HEAD/artifacts/<project-slug>/<relative-path> resolving into ~/.infer/projects/<slug>/artifacts/. A slug that is not a single local path segment or a relative path that climbs out of the subtree (filepath.IsLocal) answers 404 without reading anything; other methods answer 405, missing files and directories 404. Unauthenticated like the old infer chat route (an <img> tag cannot send the token), but bound to 127.0.0.1 only.
cmd/daemon/daemon.go: startBinding registers the route on the binding.
docs/browser-extension-protocol.md: the Artifacts section documents GET /artifacts/<project-slug>/<relative-path> with its bounds, replacing the "answers 404" note.
Tests: cmd/daemon/artifacts_test.go covers serving a file from a project's artifacts dir (bytes + image/png content type), traversal rejection with decoy files proving nothing outside the subtree leaks, plus no-slug/missing-file/directory/method cases. internal/protocols/agui/binding_test.go covers a registered route being served through a real binding and unregistered paths still 404ing.
Cross-repo: inference-gateway/opentask needs the matching rewrite in src/lib/markdown.tsx from /.infer/artifacts/... onto /.infer/projects/<project-slug>/artifacts/.... This token has no write access to that repo (viewerPermission empty), so the follow-up is filed on the current repo for routing: #1415 - #1415. The docs-site OpenTask page update is already tracked in inference-gateway/docs#866; the PR body links both.
Verification
task precommit:run (go mod tidy, go fmt + golangci-lint fmt, import-alias check, golangci-lint purego, markdownlint): clean, 0 issues.
go test ./cmd/daemon ./internal/protocols/agui: pass.
git status clean, branch up to date with origin/fix/issue-1414, PR viewable.
Activity
edenreich commentedon Sep 29, 2026
When this lands, the docs site's OpenTask page needs the matching update. inference-gateway/docs#866 tracks the page, which currently says the daemon serves
/artifacts/. The CLI's wire contract indocs/browser-extension-protocol.mdstates that the route answers 404 until then.fix: route browser-use through the infer daemon and make agui a gener…
edenreich commentedon Sep 29, 2026
@infer Can you work on this?
inference-gateway-maintainer commentedon Sep 29, 2026
Model:
ollama_cloud/glm-5.3-flash· View JobTodos
Pull Request
#1416
✅ Infer Result: Success
All work is complete and pushed. Here is the final summary for the issue:
Summary
PR #1416 (ready for review): #1416 -
feat(daemon): serve per-project artifacts over the AG-UI bindingThe daemon now serves the artifacts route the opentask extension needs. Since #1413 the binding's mux only registered
/ws, so every panel image request answered 404. This lands the per-project design proposed in the issue:Changes
internal/protocols/agui/binding.go:BindingConfig.Routesregisters optional non-WebSocket HTTP handlers next to/wsunder the same loopback listener. agui stays general purpose (stdlib-only import, so its closed depguard list is untouched), and the agui README documents the extension point.cmd/daemon/artifacts.go(new): a read-only handler forGET/HEAD/artifacts/<project-slug>/<relative-path>resolving into~/.infer/projects/<slug>/artifacts/. A slug that is not a single local path segment or a relative path that climbs out of the subtree (filepath.IsLocal) answers 404 without reading anything; other methods answer 405, missing files and directories 404. Unauthenticated like the oldinfer chatroute (an<img>tag cannot send the token), but bound to127.0.0.1only.cmd/daemon/daemon.go:startBindingregisters the route on the binding.docs/browser-extension-protocol.md: the Artifacts section documentsGET /artifacts/<project-slug>/<relative-path>with its bounds, replacing the "answers 404" note.cmd/daemon/artifacts_test.gocovers serving a file from a project's artifacts dir (bytes +image/pngcontent type), traversal rejection with decoy files proving nothing outside the subtree leaks, plus no-slug/missing-file/directory/method cases.internal/protocols/agui/binding_test.gocovers a registered route being served through a real binding and unregistered paths still 404ing.Cross-repo:
inference-gateway/opentaskneeds the matching rewrite insrc/lib/markdown.tsxfrom/.infer/artifacts/...onto/.infer/projects/<project-slug>/artifacts/.... This token has no write access to that repo (viewerPermissionempty), so the follow-up is filed on the current repo for routing: #1415 - #1415. The docs-site OpenTask page update is already tracked in inference-gateway/docs#866; the PR body links both.Verification
task precommit:run(go mod tidy, go fmt + golangci-lint fmt, import-alias check, golangci-lint purego, markdownlint): clean, 0 issues.go test ./cmd/daemon ./internal/protocols/agui: pass.git statusclean, branch up to date withorigin/fix/issue-1414, PR viewable.Model:
ollama_cloud/glm-5.3-flash· Exit Code:0· Duration: 8m 27sTokens: 6,538,393 in · 36,245 out · 6,574,638 total (60 requests)
Tool calls: 78 total · 100% success rate
Traces
Stats
Triggered by edenreich · Infer Action · OSS
feat(daemon): serve per-project artifacts over the AG-UI binding
inference-gateway-releaser commentedon Sep 30, 2026
🎉 This issue has been resolved in version 0.219.0 🎉
The release is available on:
Your semantic-release bot 📦🚀