Skip to content

Commit d1e97b8

Browse files
committed
fix(docs,speed): repoint folded doc link, correct the cap 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).
1 parent 7f03252 commit d1e97b8

4 files changed

Lines changed: 18 additions & 13 deletions

File tree

electron/ai-edition/deep-agent/agent-provider-capabilities.test.ts renamed to electron/ai-edition/deep-agent/chat-model-capabilities.test.ts

File renamed without changes.

src/components/video-editor/projectPersistence.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,8 @@ import {
3434
DEFAULT_ZOOM_MOTION_BLUR,
3535
MAX_BLUR_BLOCK_SIZE,
3636
MAX_BLUR_INTENSITY,
37-
MAX_PLAYBACK_SPEED,
3837
MIN_BLUR_BLOCK_SIZE,
3938
MIN_BLUR_INTENSITY,
40-
MIN_PLAYBACK_SPEED,
4139
type SpeedRegion,
4240
type TrimRegion,
4341
type WebcamLayoutPreset,
@@ -320,12 +318,13 @@ export function normalizeProjectEditor(editor: Partial<ProjectEditorState>): Pro
320318
const startMs = Math.max(0, Math.min(rawStart, rawEnd));
321319
const endMs = Math.max(startMs + 1, rawEnd);
322320

323-
const speed =
324-
isFiniteNumber(region.speed) &&
325-
region.speed >= MIN_PLAYBACK_SPEED &&
326-
region.speed <= MAX_PLAYBACK_SPEED
327-
? clampPlaybackSpeed(region.speed)
328-
: DEFAULT_PLAYBACK_SPEED;
321+
// Clamp an out-of-range speed rather than discarding it: a saved 25×
322+
// should become the cap, not silently reset to the 1.5× default.
323+
// Lowering MAX_PLAYBACK_SPEED widened the reset window, so the
324+
// range test now only guards against non-numeric values.
325+
const speed = isFiniteNumber(region.speed)
326+
? clampPlaybackSpeed(region.speed)
327+
: DEFAULT_PLAYBACK_SPEED;
329328

330329
return {
331330
id: region.id,

src/components/video-editor/types.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,14 @@ export const MIN_PLAYBACK_SPEED = 0.1;
395395
// frame-steps by seeking and audio export uses an offline pitch-preserved stretch.
396396
// ponytail: the editor cap and the native preview cap are the same number —
397397
// everything above this is the export path's stretch, and the editor's input
398-
// parser shouldn't accept speeds the preview cannot render. A 50× entry now
399-
// clamps to 16, not 100.
398+
// parser shouldn't accept speeds the preview cannot render. A 50× entry is
399+
// REJECTED (the field reverts to its previous value), not clamped — see
400+
// `parseCustomPlaybackSpeedInput`, which returns `too-fast` above this bound.
401+
//
402+
// NOTE: this bound is enforced on the editor input only. The LLM agent tools
403+
// (electron/ai-edition/agent-tools.ts) still accept any positive speed, so an
404+
// agent-authored region can exceed it: preview clamps to MAX_NATIVE_PLAYBACK_RATE
405+
// while export renders the true speed.
400406
export const MAX_PLAYBACK_SPEED = 16;
401407
export const MAX_NATIVE_PLAYBACK_RATE = 16;
402408

technical-documentation/architecture/llm-providers.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The provider layer defines model metadata, protects credentials, discovers model
88
| [`electron/ai-edition/llm-config-store.ts`](../../electron/ai-edition/llm-config-store.ts) | `LlmConfigStore` — plain JSON for selection, `safeStorage` blob for credentials. |
99
| [`electron/ai-edition/llm-provider-auth.ts`](../../electron/ai-edition/llm-provider-auth.ts) | Model-list discovery per provider. Despite the filename it performs no authentication any more — see [Known gaps](#known-gaps). |
1010
| [`electron/ai-edition/deep-agent/chat-model.ts`](../../electron/ai-edition/deep-agent/chat-model.ts) | `createOpenScreenChatModel` — the single transport. Picks a `@langchain/*` chat model class per provider. |
11-
| [`electron/ai-edition/deep-agent/agent-provider-capabilities.ts`](../../electron/ai-edition/deep-agent/agent-provider-capabilities.ts) | Per-provider reasoning-effort capability and its LangChain wire options. |
11+
| [`electron/ai-edition/deep-agent/chat-model.ts`](../../electron/ai-edition/deep-agent/chat-model.ts) | Per-provider reasoning-effort capability and its LangChain wire options. |
1212
| [`electron/native-bridge/services/aiEditionService.ts`](../../electron/native-bridge/services/aiEditionService.ts) | IPC surface: connect / disconnect, snapshot, `llmListProviderModels`. |
1313
| [`src/components/ai-edition/ProviderSettings.tsx`](../../src/components/ai-edition/ProviderSettings.tsx) | Renders cards and forms directly from `PROVIDER_DEFINITIONS`. |
1414

@@ -111,14 +111,14 @@ Everything returns `{models, error?}` rather than throwing, so the settings UI c
111111

112112
1. Add a complete `ProviderDefinition` in `provider-registry.ts` (auth kind, env keys, default model, base URL, `wireProtocol`, reasoning support). Widen `authKind` if the provider is not API-key-based.
113113
2. Add a branch in `createOpenScreenChatModel` if none of the three existing adapters fits.
114-
3. Add a capability branch in `agent-provider-capabilities.ts` if the provider exposes reasoning, and constrain `getReasoningEffortOptions` if its scale is not the full six tiers.
114+
3. Add a capability branch in `chat-model.ts` if the provider exposes reasoning, and constrain `getReasoningEffortOptions` if its scale is not the full six tiers.
115115
4. Add a discovery branch in `aiEditionService.llmListProviderModels`, plus its fetch helper in `llm-provider-auth.ts`.
116116
5. Extend the native-bridge contracts if the provider needs operations the existing IPC surface doesn't cover.
117117
6. Confirm `ProviderSettings.tsx` renders the right fields from the registry metadata alone, then add registry, transport, and UI tests.
118118

119119
## Known gaps
120120

121-
- **`normalizeReasoningEffort` in `provider-registry.ts` is dead.** It is exported but has no caller anywhere in the repo; `normalizeReasoningEffortForCapability` in `agent-provider-capabilities.ts` is the live one. The two also disagree — the dead copy's strategy union knows `custom-openai-account` but not `minimax-thinking`. Delete it rather than fixing it.
121+
- **`normalizeReasoningEffort` in `provider-registry.ts` is dead.** It is exported but has no caller anywhere in the repo; `normalizeReasoningEffortForCapability` in `chat-model.ts` is the live one. The two also disagree — the dead copy's strategy union knows `custom-openai-account` but not `minimax-thinking`. Delete it rather than fixing it.
122122
- **`custom-openai-account` is a phantom strategy.** It appears in `ReasoningCapability["strategy"]` but no branch of `getReasoningCapability` returns it, and no branch of `buildLangChainReasoningOptions` handles it. Left over from the removed ChatGPT provider.
123123
- **`llm-provider-auth.ts` is misnamed.** It performs no authentication since the device flows were removed — it is purely model-list discovery. `model-discovery.ts` would say what it does.
124124
- **MiniMax discovery spends the user's key.** Nine probe requests per discovery click, uncached, at `max_tokens: 1`. Cache per key if it ever moves to a hot path.

0 commit comments

Comments
 (0)