Repository navigation
Editor: Polish, Ask the editor, and chapters with your Omarchy agent - #42
Draft
ryanrhughes wants to merge 16 commits into
Draft
ryanrhughes wants to merge 16 commits into
ryanrhughes wants to merge 16 commits into
Conversation
A bundle's chapters, title and description live in chapters.json, each chapter at a source time so later cuts, speed changes and inserts move it with the video. A chapter whose start was cut begins where the recording picks up again; one cut away entirely gives way to the next. Chapters::youtube_description makes the text to paste into YouTube: the first chapter at 00:00 and chapters under ten seconds left out. omareel apply's set-chapters writes the file (at, title per chapter, in either timeline, plus title and description), only once the whole run applied and project.json is saved; a dry run writes nothing. describe lists the chapters with their output times. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Polish (Ctrl+Shift+P), "Ask the editor…" and Write description run the agent chosen in Omarchy (~/.config/omarchy/defaults/agent) once, headless, in the bundle's directory, with the omareel skill and an instruction. It edits through omareel apply, so each change lands in the editor through the live reload as one undo step. A drawer over the side panel shows which agent runs and that the timeline, transcript and frames go to its provider, before anything runs; then its messages, commands, each apply, the frames it looked at, and the cost. Stop kills the agent's process group and anything it started outside it. Chapters show as flags on the ruler and copy as a YouTube description. The runner is Qt-free (agent/runner.rs): an adapter per agent (Claude Code's stream-json with --restricted, Bash limited to omareel and dontAsk; Codex's exec --json in its workspace-write sandbox), a stream parser, and the run on transcript::job's process groups. Other agents get a message saying which ones work. omareel agent BUNDLE polish|chapters|ask runs it from the command line as JSON lines. apply takes the operations as its argument too, since Claude Code refuses a heredoc under a Bash(omareel:*) rule. Tests read a recorded Claude Code run and a refused command, Codex's events, a fake agent (tests/tools/fake-agent.py, both streams) end to end in Rust and in ctest with the real omareel, and Stop killing the group. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…areel run_streaming went straight back to reading after each chunk, so a command that printed more often than every 20 ms was never checked against its deadline or a cancel: an agent streaming its events could run past the 30-minute limit. Every pass through the loop checks now. Each command also gets PR_SET_PDEATHSIG (SIGKILL) before it starts, so it dies with the thread that runs it, which waits for it, and with the editor or `omareel agent` when either is killed (SIGKILL included), rather than running on with no timeout and nobody to stop it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Qt's Text and Label guess rich text by default, and rich text loads <img src=http://…> from the network: a chapter title the agent wrote (from speech in the transcript, or text on screen) made the editor fetch a URL of the agent's choosing. Every Text and Label that shows a string from somewhere else now says Text.PlainText: chapter titles and descriptions, the agent's messages, tooltips (chapter flags), captions and keystrokes, file and preset names, menus, buttons and errors, in the editor, the launcher and the recording bar. Nothing in the app used markup, so nothing else changes. The test is in the next commits' test_editor case, which loads the drawer and a tooltip with an <img> title and checks that no request is made and the markup shows as text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…at isn't
The agent reads content that can carry prompt injection (speech, text on screen), so it is
treated as untrusted.
Scope: Bash(omareel:*) allowed the whole CLI: export or frame -o anywhere, apply on another
bundle, record, skill install, nested agent runs. The runner now sets
OMAREEL_AGENT_SCOPE=<bundle>\n<scratch>, and omareel checks its own command line against it
first thing in main(), whichever omareel the agent finds (agent/scope.rs): only describe,
apply, frame -o into the scratch directory, and transcribe on that bundle, and help, run;
everything else is refused with a message and exit status 126. Paths are compared resolved
(symlinks, ..); frame refuses an output that is a symlink; apply reads an operations file only
from the bundle or scratch directory, and the files operations name (insert, music, a
background image set with set) must be there too. Claude's allow rules are narrowed to those
subcommands.
Codex: workspace-write still reads any file, and the person's config.toml kept their MCP
servers (a remote one here) and could turn network on. It runs with --ignore-user-config and
--ignore-rules now, and -c overrides for network access, writable roots and web search (a
mcp_servers={} override merges rather than clears, and naming a server after ignoring the
config fails, so MCP servers go with the config). The comments and USAGE now say what is
contained (writes, network) and what isn't (reads, its shell), and Codex is called
experimental (Adapter::experimental).
Processes: only Stop swept what left the agent's process group; a session leader survived a
normal end. Every end (finished, failed, timed out, stopped) now kills each process whose
environment carries the run's scope, which also finds daemons re-parented away from the agent
(PR_SET_CHILD_SUBREAPER would make the editor a parent of strangers' orphans it never reaps).
Runner::with_timeout tests the timeout.
Scratch: runs on one bundle shared a directory, and a second run removed the first's. Each run
gets its own (mkdtemp under ~/.cache/omareel/agent/), removed when its runner's next run starts
or the runner goes, so the drawer can still show the frames; a day-old one is cleaned up.
Chapters: set-chapters saved project.json first, so a chapters.json that couldn't be written
left the cuts saved and a retry applied them twice. chapters.json is written aside first (a
failure saves nothing), then project.json, then the chapters are moved into place.
Tests: each refusal (scope unit tests and the real binary in agent_fake), scoped apply, the
sweep after a normal end and a timeout (with a session leader and a daemon), unique scratch
directories, and a chapters.json that can't be written.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The previous commit staged them without their executable bits; agent_fake runs the fake agent directly, so it needs them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Consent: the top bar's Polish and Ctrl+Shift+P started the agent on the first press, with the
disclosure appearing at the same moment or only in a tooltip. Now an agent the person hasn't
started before only opens the drawer: which agent runs, that it reads the timeline, the
transcript and frames of the video and sends them to its provider, a note for Codex that its
commands can read other files (experimental), and a Start button ("Start polishing"). Starting
remembers that agent (agent/consent.rs, ~/.config/omareel/agent.json), so later runs start
straight from the shortcut; the drawer's "Ask first" takes it back. AgentRunner refuses to
start an agent that wasn't allowed, whatever QML asks.
Stale project: the agent could start from a project.json older than what the editor showed.
The drawer saves (the project name too) before starting, and doesn't start if that fails.
While the agent runs, the editor is read-only (Editor.readOnly, Document::set_read_only): an
edit is undone as soon as it is made and leaves nothing to save, undo and redo do nothing,
and the agent's changes still come in through the reload. The timeline says "The agent is
editing… Stop to edit" with a Stop button; the side panel, edit shortcuts, split, insert,
crop, aspect, presets, undo, redo and renaming are off. All of it comes back when the run
ends or stops.
Undo: the drawer said each change is one undo step, but chapters.json isn't in the project's
history; it now says chapters and the description can't be undone.
Tests: test_editor loads the drawer and a tooltip with an <img src=http://…> title, message
and chapter (no request is made, all show as plain text; it fails with the request when a
Label lacks PlainText), the consent flow (Start runs and saves, the next Polish runs at once,
Ask first asks again), and Editor.readOnly; Rust tests for the read-only document and the
consent file.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Until the agent is allowed, the drawer's Polish is bordered like Write description, so Start is the one accent button. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y config; YouTube limits Fixes from the 0.6 review of #42: - Inside an agent's scope, apply treated any new string naming an existing path as a file, so a label or caption saying "/usr/bin" was refused, while a file:// URL got through unresolved. It now checks the project's file fields (background image and wallpaper, inserted videos, music), with file:// URLs decoded. - When agent.json couldn't be written, consent held "for this window" only until Start re-read the file and took it back, so Start always refused. The window keeps it now. - Chapter titles and the YouTube title are capped at 100 characters and the description at 5000, YouTube's limits, since they go to the clipboard as a description. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # CMakeLists.txt # crates/omareel_core/src/agent/apply.rs # crates/omareel_core/src/transcript/job.rs # src/ui/qml/ExportDialog.qml
… kept in the bundle Merges #31's fix (a refused apply removes only its own copies; Applied carries them). Found by the 0.6 adversarial review of #42: inside an agent's scope a background image in the scratch directory was allowed, but the runner removes that directory when the run ends, leaving the project pointing at nothing. apply copies such an image into media/ and points the project there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Stacked on #36 (agent-integration). Merge after it.
Brings the agent workflow into the editor: no terminal needed. It uses the coding agent picked in Omarchy (
omarchy-default-agent).Features
Ctrl+Shift+P): the agent tightens the recording with the omareel skill: trims, idle cuts and pauses, zooms, and keystrokes where shortcuts matter. Then it checks contact sheets.chapters.json. Chapters are stored at source times and mapped onto the edited timeline. They show as flags on the ruler, and "Copy YouTube description" produces the description text. A newset-chaptersapply op writes them;describeshows them.omareel agent BUNDLE polish|chapters|ask TEXT…prints the run as JSON lines.applyalso takes the operations JSON directly as an argument (Claude Code refuses heredocs under aBash(omareel …)rule).Consent and containment. The agent is treated as untrusted: on-screen text and speech can carry prompt injection.
Nothing runs without a click. The first Polish or shortcut for an agent only opens the drawer. The drawer names the agent and what goes to its provider (timeline, transcript, frames), with a Start button. Consent is remembered per agent in
~/.config/omareel/agent.json, and "Ask first" revokes it.Scope enforced by
omareelitself: the runner setsOMAREEL_AGENT_SCOPE. Inside it, only these run:describe,applyandtranscribeon this bundle;frame -ointo the run's own scratch directory;help.Everything else exits 126: record, export, edit, skill, agent, other bundles, outputs elsewhere, and
applyops naming files outside the bundle. Paths are compared after resolving symlinks and... Claude's allow rules are narrowed to the same subcommands, and it runs with--permission-mode dontAsk.Codex (experimental): runs with
--ignore-user-config --ignore-rules, which drops the user's MCP servers. Network, web search and extra writable roots are off. Reads aren't restricted, and the UI says so.No markup: every UI text showing agent-, transcript- or bundle-supplied strings is plain text. A test proves an
<img src=http://…>chapter title makes no request.Process lifetime:
PR_SET_PDEATHSIG, so it dies with the editor or CLI.Chapters are written atomically with apply: temp file, then
project.json, then rename. They can't be undone, and the drawer says so.Tested
cargo test -p omareel_core(335 + 58 + 3). Offscreenctestincludingagent_fake, which runs the real binary's describe, apply and frame and every scope refusal againsttests/tools/fake-agent.py.ls /and read/etc/hostnamewas refused.Not verified
--ignore-user-configdrops MCP servers in a real session.For you to judge
OMAREEL_AGENT_MODELoverrides it). The timeout is 30 minutes, and there is no spending cap.background.imageto a wallpaper outside the bundle is refused.🤖 Generated with Claude Code