feat(dgw): generate a session log with AI - #2008
Draft
irvingouj@Devolutions (irvingoujAtDevolution) wants to merge 13 commits into
Draft
irvingouj@Devolutions (irvingoujAtDevolution) wants to merge 13 commits into
irvingouj@Devolutions (irvingoujAtDevolution) wants to merge 13 commits into
Conversation
A .slog pushed for a session that already has a recording is now listed
in a new `logs` field of recording.json, named `log-{n}.slog`.
The `files` list keeps holding recordings only, so released players and
streamers keep working.
A log-only session (AD Console) still lists its .slog in `files`.
The `logs` field is omitted when empty, so existing manifests stay the same.
The session ZIP download now includes the logs.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The recording manager appends the log as the next log-{n}.slog in the
manifest logs list, so it never races with a push rewriting the manifest.
Sessions still recording and sessions without a recording are refused.
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>
The ai-log task turns the terminal recordings of a finished session (asciicast, or TRP through the terminal streamer decoder) into a timed plain-text transcript, sends it to the AI provider in chunks of about 100k input tokens, and appends the actions as a new .slog log of the session. The log uses the shipped .slog schema; session.start also carries source, model and promptVersion. Video-only sessions fail with an unsupported recording type error. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A running ai-log task now reports step describing with the number of transcript chunks already sent and the total, and the OpenAPI document and generated clients describe the new substate. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A post-session .slog push kept the session "connected", so /shadow streamed the finished recording instead of refusing like master did. /shadow now closes with "streaming ended" when the ongoing push is a log, and log chunks no longer wake /shadow streamers. The ongoing push now tracks which manifest entry it writes to (recording or log, by index) instead of a bool, which removes the "no log file" bug branch. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The ZIP now holds logs as well as recordings, so "clip" no longer fits. The public endpoint doc is unchanged, so the OpenAPI output is too. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…limit A truncated answer silently loses its last actions, so the caller gets Error::Truncated and can ask again with a shorter input. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The recording is no longer read into memory. The task streams .cast and .trp output into transcript chunk files in its workspace (<RecordingPath>/.provisioner-tasks/<task-id>/), saves the actions of each chunk as a checkpoint so a retry resumes at the first chunk without one, and merges the checkpoints into the .slog. A chunk whose answer is truncated is asked again in two halves, down to a floor. The workspace is deleted when the task finishes, and stale ones are removed when the task system starts. The manifest is read through the recording manager, which also copies the finished log into the session. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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 newlog-{n}.slogin the manifestlogslist..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 }Also adds
Error::Truncatedto the AI crate (#2005) for answers cut at the token limit. Includes #2003 (merged in), since the log has to land inlogs.Tested:
tasks15/15 (end-to-end against a mock provider incl. resume + no key in any file),tasks::lib 32/32,recording::13/13,gateway_ai14/14,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