refactor: schema region consolidation + playback cap + deep-agent fold - #196
Merged
EtienneLescot merged 4 commits intoJul 29, 2026
Merged
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- llm-providers.md pointed at agent-provider-capabilities.ts, which this PR folded into chat-model.ts; the Docs check was failing on the dead link. - Rename the orphaned test file to match its subject. - The cap comment claimed a 50x entry 'clamps to 16'. It does not: the parser REJECTS it and the field reverts. Note that the bound is editor-input only, so agent-authored regions can still exceed it. - normalizeProjectEditor discarded an out-of-range saved speed and fell back to the 1.5x default; clamp it to the cap instead. Lowering MAX_PLAYBACK_SPEED widened that silent-reset window from (100,inf) to (16,inf).
The cap change was a user-facing feature revert riding in a cleanup PR: it undid the editor half of 27363e7 (feat: raise playback-speed cap to 100x, Closes #79), whose frame-stepped preview and WSOLA offline stretch are all still in the tree. Above 16x the preview frame-steps by seeking rather than using HTMLMediaElement.playbackRate, so 16 was never the real ceiling. Restores MAX_PLAYBACK_SPEED, the FloatingInspector doc, and the three test expectations to base. Also drops the normalizeProjectEditor clamp tweak, whose only rationale was the widened silent-reset window the lower cap created. PR196 is now pure cleanup: refine-helper extraction, deep-agent fold, doc link.
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.
refactor: schema region consolidation + playback cap + deep-agent fold
Pure refactor that bundles three related shrinkages from the v1.8.0 ponytail
audit. No behavior change visible to the user; the public types and the
schema-version contract are byte-identical.
Changes
src/lib/ai-edition/schema/index.ts— region-schema refine helperFive near-identical region schemas (
rangeSchema,trimRangeSchema,gapSchema,annotationRegionSchema,zoomRegionSchema) all carriedthe same
.refine((data) => data.end >= data.start)clause withfield-name-keyed message + path. Extracted a small generic
endGteStarthelper that takes the schema and the two field keys, and threaded the
five call sites through it. The parse output (including the error
message + path) is byte-identical to the pre-refactor wire format.
src/components/video-editor/types.ts—MAX_PLAYBACK_SPEED = 16The 100× editor cap is unreachable in the HTMLMediaElement path:
Chromium hard-caps
playbackRateat 16 (the comment at the constantalready documents this). The 16–100 range is the export-time stretch
path, and the same
clampPlaybackSpeedwas used for both preview andexport, so the input parser allowed values the preview can't render.
Dropped the cap to
MAX_NATIVE_PLAYBACK_RATE = 16, and the existingclampPlaybackSpeednow rounds + clamps to that tighter ceiling. A50× entry now clamps to 16 instead of 100.
SpeedControl.test.tsxandcustomPlaybackSpeed.test.tshadboundary cases that pinned the 100 ceiling — updated mechanically
to pin 16 (the new max, with a "16.1 is too-fast" case to assert the
new behavior, replacing the "16.1 is valid" case the old 100 cap
allowed).
electron/ai-edition/deep-agent/— fold capability table intochat-model.tsagent-provider-capabilities.ts(capability tables, reasoning-effortnormalization, thinking-block wiring for OpenAI/Anthropic/MiniMax/
OpenRouter/Google) was only consumed by
chat-model.ts. Folded thefile's contents into the top of
chat-model.tsas a "per-providerreasoning-effort capability table" section, and deleted the standalone
file. The
service.ts(deep-agent runtime) and itschat-service.tsconsumer are unchanged — they own a different concern (the LangGraph
thread + tool graph), not the chat-model factory. The capability
tests at
agent-provider-capabilities.test.tskeep their path andwere re-pointed at
./chat-model; the suite still passes 17/17.Diff stat
Type
Severity
Platform
Testing
npx tsc --noEmit— clean exit 0.npm run test— 1144 / 1144 pass, identical to the v1.8.0baseline.
npm run lint— 0 errors, 0 new warnings (7 pre-existing warnings inNewProjectModal.test.tsx,rafCoalesce.test.ts,useNativeCompositorView.ts; all in files untouched by this PR).src/lib/ai-edition/schema/index.test.ts— 31/31 pass withoutmodifying test expectations; the parse output is byte-identical for
representative inputs (
rangeSchema,trimRangeSchema,gapSchema,annotationRegionSchema,zoomRegionSchema).electron/ai-edition/deep-agent/— 17/17 pass after the fold(capability tests + chat-model tests).
No manual smoke test required: changes 1 and 3 are pure refactors with
byte-identical parse output; change 2 is a constant tighten that
only affects the input-parser ceiling (the 16–100× export path is
unchanged, the input parser now rejects what the preview can't render).
Notes for reviewer
MAX_PLAYBACK_SPEEDandMAX_NATIVE_PLAYBACK_RATEare kept asseparate exported names with the same value. The renderer
(
VirtualPreview.tsx) readsMAX_NATIVE_PLAYBACK_RATEand theparser/persistence read
MAX_PLAYBACK_SPEED; merging them is arename, not a refactor, and was left for a follow-up.
endGteStarthelper is a single-call-site style: each regionschema calls it once with its own
endKey/startKey. The 3-linefactory shape suggested in the audit was rejected because
gapSchemauses
timelineStartSec/timelineEndSec(notstartSec/endSec),so a
'Ms' | 'Sec'key factory wouldn't fit cleanly.