feat(dgw): generate a session log with AI - #2008
Draft
irvingouj@Devolutions (irvingoujAtDevolution) wants to merge 3 commits into
Draft
irvingouj@Devolutions (irvingoujAtDevolution) wants to merge 3 commits into
irvingouj@Devolutions (irvingoujAtDevolution) wants to merge 3 commits into
Conversation
irvingouj@Devolutions (irvingoujAtDevolution)
force-pushed
the
feat/task-api
branch
from
September 28, 2026 20:33
9ca40e6 to
e8168ef
Compare
irvingouj@Devolutions (irvingoujAtDevolution)
force-pushed
the
feat/ai-log-task
branch
from
September 28, 2026 20:33
a58e30f to
dad8f5e
Compare
irvingouj@Devolutions (irvingoujAtDevolution)
force-pushed
the
feat/task-api
branch
from
September 29, 2026 20:14
e8168ef to
8959afb
Compare
irvingouj@Devolutions (irvingoujAtDevolution)
force-pushed
the
feat/ai-log-task
branch
from
September 29, 2026 20:14
dad8f5e to
42a2486
Compare
irvingouj@Devolutions (irvingoujAtDevolution)
force-pushed
the
feat/task-api
branch
from
September 30, 2026 03:01
8959afb to
fdf8a5b
Compare
irvingouj@Devolutions (irvingoujAtDevolution)
force-pushed
the
feat/ai-log-task
branch
from
September 30, 2026 03:01
42a2486 to
5ffa560
Compare
irvingouj@Devolutions (irvingoujAtDevolution)
force-pushed
the
feat/task-api
branch
from
September 30, 2026 16:13
fdf8a5b to
ae77d60
Compare
irvingouj@Devolutions (irvingoujAtDevolution)
force-pushed
the
feat/ai-log-task
branch
from
September 30, 2026 16:13
5ffa560 to
8d78bdb
Compare
irvingouj@Devolutions (irvingoujAtDevolution)
force-pushed
the
feat/task-api
branch
from
September 30, 2026 18:07
ae77d60 to
391cd2e
Compare
irvingouj@Devolutions (irvingoujAtDevolution)
force-pushed
the
feat/ai-log-task
branch
from
September 30, 2026 18:07
8d78bdb to
3e98327
Compare
irvingouj@Devolutions (irvingoujAtDevolution)
added a commit
that referenced
this pull request
Sep 30, 2026
…#2003) Lets Gateway attach its own non-recording artifacts (AI analysis first) to a session recording, without breaking released players, which treat every `files` entry as playable. - the manifest gets an `artifacts` object next to `files`, hard-typed per kind (only `ai-analysis` today): ```json { "files": [ { "fileName": "recording-0.webm", "startTime": 1787255035, "duration": 25 } ], "artifacts": { "ai-analysis": [ { "fileName": "ai-analysis-0.slog" } ] } } ``` - artifacts are written by Gateway only, like recordings: `add_artifact(id, kind)` has the recording manager create the next `<kind>-N.<ext>` in the session folder, list it and return its path, and the caller writes into it; it fails when the session has no recording, so a deleted recording is never recreated. There is no artifact push, so a push token can't upload one. Nothing calls it yet: the first caller is the AI log task in #2008 - JREC push is unchanged, `slog` included: AD console `.slog` is that session's recording and stays in `files` - artifacts stay out of the recording lifecycle: no recording policy, disconnect TTL, `/shadow` or duration handling - an artifact can be added while a recording is being pushed; the recording re-reads the manifest on disconnect, so neither entry is lost - `artifacts` is omitted when empty, so existing manifests are byte-for-byte the same - session ZIP downloads include artifacts Design notes: `devolutions-gateway/src/recording.intent.md`. Tested: `artifacts::` + `recording::` + `api::jrec::` 22/22, `dvls_compatibility` 24/24. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The packet decoding is shared with the live stream decoder, so a finished recording can be turned into asciicast without tailing it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Runs the ai-log task end to end: streams the terminal recording into chunk files in a task workspace, describes each chunk with the AI (checkpointed so a retry resumes, splitting a chunk when the answer is cut at the output limit), writes the .slog and copies it into a new `ai-analysis` artifact from the recording manager (`add_artifact`, #2003). The task reads a finished recording through the recording manager (`get_finished`). Also regenerates the ai-log substate docs. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The AI crate now reports the model that answered and the tokens each request used, but the ai-log task dropped both. Task records are kept for audit, and AI budgets will need the token counts. Each chunk checkpoint now holds the reported model and the token usage next to the actions, so a retry keeps the counts of the chunks it does not ask again. Answers cut at the output limit and asked again in two halves count too. The task result adds the model and the total usage, which is absent when the provider did not report it for every request. The .slog names the reported model, usually a dated version of the requested one, and falls back to the requested model.
irvingouj@Devolutions (irvingoujAtDevolution)
force-pushed
the
feat/task-api
branch
from
September 30, 2026 23:27
391cd2e to
e4e76f3
Compare
irvingouj@Devolutions (irvingoujAtDevolution)
force-pushed
the
feat/ai-log-task
branch
from
September 30, 2026 23:27
3e98327 to
6949cfa
Compare
This branch has not been deployed
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.
Fills in the
ai-logtask: DVLS starts it, Gateway turns the session's terminal recording into text, asks the AI what the user did, and adds the answer as a newai-analysis-{n}.slogartifact in the manifest (artifacts, from #2003)..castand.trp, read as a stream (newTrpOutputReader), so memory is bounded by the chunk size, not the recording size; WebM fails as unsupported for now<RecordingPath>/.provisioner-tasks/<task-id>/(same access as recordings), deleted when the task ends and cleaned up at startup[seconds].slogformat,session.startgetssource: "ai",model,promptVersion; progress shows asrunning { step: "describing", done, total }get_finished, sessions still recording are refused) and the log is copied into an artifact from feat(dgw): list Gateway-generated artifacts in the recording manifest #2003 (add_artifact)Also adds
Error::Truncatedto the AI crate (#2005) for answers cut at the token limit (finish_reason: length/stop_reason: max_tokens).Tested:
tasks15/15 (end-to-end against a mock provider incl. resume + no key in any file), libtasks::+recording::+artifacts::+api::jrec::55/55,gateway_ai12/12,dvls_compatibility24/24. A real run with OpenAIgpt-6-lunaon a 9-min Ubuntu recording passed before the streaming rework; not re-run yet.Stacked on #2007.
🤖 Generated with Claude Code