Static artifact publishing end-to-end#53
Open
obaid wants to merge 1 commit into
Open
Conversation
Agents can now publish a static web artifact and have it served at
{agent.slug}.provisionagents.com/{path}.
- CaddyArtifactService: rebuilds the agent's /etc/caddy/sites/{slug}.caddy from
its live artifacts (file_server per static artifact) and reloads Caddy over
the CommandExecutor (SSH/Docker).
- PublishArtifactService: orchestrates publish/unpublish — ensures the
Cloudflare DNS record, syncs Caddy, tracks status/public_url, and drops the
DNS record when the agent has no artifacts left.
- ArtifactController (agent-token): POST/GET/DELETE /api/artifacts for agents.
- Dashboard: an Apps tab on the agent page lists published artifacts with their
public URL + an unpublish action (web route).
App (running-process) and gated artifacts are scaffolded but not yet wired —
those are the next stages. Full suite green (752).
This was referenced Jul 1, 2026
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.
Feature 1, PR 2 of ~5. Stacked on #52 (foundations) — review/merge that first. This is where artifact publishing first works, for static sites.
What
An agent publishes a static artifact and it's served at
{agent.slug}.provisionagents.com/{path}.CaddyArtifactService/etc/caddy/sites/{slug}.caddyfrom its live artifacts (afile_serverhandle_pathper static artifact) and reloads Caddy over theCommandExecutor(SSH on cloud, Docker locally).PublishArtifactServicestatus/public_url, and removes the DNS record once the agent has no artifacts left. Marks the artifacterrorand rethrows if the sync fails.ArtifactController(agent-token)POST/GET/DELETE /api/artifacts— same auth channel as tasks. Static-only for now; validates + sanitizespath_slug/source_dir.Artifact files live under the agent's workspace at
/root/.openclaw/agents/{id}/public/{source_dir}— the agent writes them, then publishes to wire up Caddy.Tests
tests/Feature/Artifacts/(16 new): Caddy config generation + synced-via-mocked-executor, publish/unpublish orchestration (DNS + Caddy mocked, incl. error path), the agent-token API (publish/list/unpublish/cross-agent 404/bad-slug/no-server), and the dashboard (show props + web unpublish + team scoping). Full suite green (752); type-check + build clean.Next
Still needs the Forge env vars from #52 to create real DNS; without them publishing still writes Caddy config (useful with a manual/wildcard DNS setup) and just skips the Cloudflare call.