-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat(coderd): add task log snapshot storage endpoint #21644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(coderd): add task log snapshot storage endpoint #21644
Conversation
6dbd8aa to
f91f4ef
Compare
010ee8f to
36f7af4
Compare
| r.Post("/log-source", api.workspaceAgentPostLogSource) | ||
| r.Get("/reinit", api.workspaceAgentReinit) | ||
| r.Route("/tasks/{task}", func(r chi.Router) { | ||
| r.Post("/log-snapshot", api.postWorkspaceAgentTaskLogSnapshot) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review: Diverge from RFC/ticket /snapshot -> /log-snapshot because this endpoint will only ever accept logs. If we ever expand snapshot functionality with additional data (say, content/git diff), that will require a new endpoint and this will avoid confusion.
This change adds a POST /workspaceagents/me/tasks/{task}/log-snapshot
endpoint for agents to upload task conversation history during
workspace shutdown. This allows users to view task logs even when the
workspace is stopped.
The endpoint accepts agentapi format payloads (typically last 10
messages, max 64KB), wraps them in a format envelope, and upserts to the
task_snapshots table. Uses agent token auth and validates the task
belongs to the agent's workspace.
Closes coder/internal#1253
36f7af4 to
88dfd8a
Compare
Documentation CheckNo Changes NeededThis PR adds an internal agent-to-server endpoint (
Why no user-facing docs needed:
The existing task documentation in Automated review via Coder Tasks |
0e62bfa to
61ca1e0
Compare
61ca1e0 to
cfa9fd0
Compare
638cf53 to
6f0810d
Compare
This change adds a POST /workspaceagents/me/tasks/{task}/log-snapshot
endpoint for agents to upload task conversation history during
workspace shutdown. This allows users to view task logs even when the
workspace is stopped.
The endpoint accepts agentapi format payloads (typically last 10
messages, max 64KB), wraps them in a format envelope, and upserts to the
task_snapshots table. Uses agent token auth and validates the task
belongs to the agent's workspace.
Closes coder/internal#1253