You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
transcribe_audio discards the timestamps Whisper already returns past 30 s; add opt-in segment/word timestamps #483
Source: field report from an Opus 5.5 session on lem, 2026-09-25/26.
The task returns plain text only. For a 2:41 generated song, cut into 18 lip-synced shots on phrase boundaries, the session needed word and segment times. It replaced the task with local mlx-whisper (word_timestamps=True) and also used that to confirm each dialogue shot spoke its line.
Past 30 s, the task already asks Whisper for return_timestamps=True (its long-form mode needs it), then keeps only result["text"]. The chunks carrying start/end times are thrown away.
expected:
An opt-in timestamps: "segment" | "word" argument returns the chunks as a JSON result (start, end, text), chunked for long audio. The default output stays text.
With it, a music video can be cut to the lyric, and lines can be checked against shots, without leaving dw.
triage: escalate — adds a new task argument (timestamps: segment|word) that switches transcribe_audio's result from text to JSON, so one command would have two return kinds; the returns:"json" / content_type validation and list_tasks' assessment grouping assume one per command, and word-level long-form Whisper is its own path. Needs sign-off on the shape (flag vs. a separate command) before a fix session builds it. (claude-opus-5-5 via anthropic)
Approved. Add an opt-in timestamps: \"segment\" | \"word\" argument to transcribe_audio. When set, return a dict of chunks (start, end, text) instead of the plain string; default (unset) stays text, unchanged.
On the triage concern: checked register_command's returns= kinds (dw/tasks/task.py) — transcribe_audio is declared returns=\"artifact\", which imposes no fixed shape. The "one command, one return kind" assumption only binds returns=\"scalar\"/\"json\" commands (the assess probes, list_tasks's assessment grouping). So this doesn't need a new command, a returns variant, or any change to scalar_result_validation.py/content_types.py/list_tasks — it's contained to audio_transcription.py and its get_task docstring/schema.
One thing to get right in the fix: return_timestamps=True is currently only requested past the 30s long-form threshold (_WHISPER_WINDOW_SECONDS). timestamps: \"word\" (or \"segment\") on a clip under 30s needs to request it explicitly too, rather than silently no-op'ing because the long-form branch didn't fire.
Removing owner:don + status:needs-approval, handing to the implementer.
triage: work — Don approved the shape (opt-in timestamps: "segment"|"word" on transcribe_audio, returns="artifact", contained to dw/tasks/audio_transcription.py + its schema/docstring). Request return_timestamps explicitly under 30 s too, not only in the long-form branch; default output stays text. (claude-opus-5-5 via anthropic)
Fixed and deployed by claude-sonnet-5 (anthropic).
transcribe_audio (dw/tasks/audio_transcription.py) now takes an opt-in timestamps kwarg: "segment" requests return_timestamps=True, "word" requests return_timestamps="word" (works on both seq2seq Whisper and CTC pipes). Either returns {"text": ..., "chunks": [{"start", "end", "text"}, ...]} instead of the plain string; a step returning this shape must set result.content_type to application/json (readable via MCP's get_output_text, which already accepts JSON). Unset timestamps is unchanged — still plain text, and still only auto-requests return_timestamps=True past the 30 s long-form threshold for Whisper.
Per the approved shape: an explicit timestamps request now fires regardless of clip length (covered by test_timestamps_requested_under_thirty_seconds_too) rather than only past 30 s — the under-30s no-op Don flagged doesn't happen. An invalid timestamps value raises ValueError. Docs updated in docs/TASKS.md's Speech Transcription section.
Shipped as commit d3ecf60, merged to develop at 57c3fc6, deployed to lem (develop @ 57c3fc6, healthy).
Tests: 5 new cases in tests/test_transcribe_audio.py (word/segment chunk shapes, under-30s explicit request, unset-stays-text, invalid-value rejection) plus the full existing suite, all passing; ruff clean on changed files.
Suggested regression case (smoke suite): call transcribe_audio on a short (<30s) known-speech clip with timestamps: "word", result.content_type: "application/json"; expect the job's output to decode as {"text": <non-empty>, "chunks": [...]} with each chunk carrying numeric start/end and non-empty text, and no return_timestamps-related error even though the clip is under 30s.
Verified by claude-opus-5-5 (anthropic) against lem develop @ 57c3fc6, over MCP only.
get_task("transcribe_audio") lists the new timestamps parameter. Its description says that "segment"/"word" returns {text, chunks} and needs result.content_type: "application/json".
I ran one inline workflow with 4 steps (job a82464c58b9f, workspace qa-ep73, succeeded in 13 s):
word, under 30 s (asset:qa-cast/priya-voice.wav, about 6 s): returned {"text": "Priya, did the stashios go on all again?", "chunks": [...]} with 8 word chunks, each with numeric start/end (0.0–5.82) and non-empty text. So the explicit request takes effect under 30 s instead of being silently ignored.
segment, same clip: returned 1 chunk, {start: 0.0, end: 5.0, text: ...}.
segment, past 30 s (asset:qa-cast/ep55-episode.mp4): returned 10 segment chunks, 0.0–49.46 s, contiguous and on phrase boundaries. This is the long-form case from the original report.
timestamps unset: plain text/plain output (Priya. Did the stashios go on all again?), unchanged.
I also checked two edge cases:
timestamps: "sentence" fails the job with timestamps must be one of ('segment', 'word'), got 'sentence' (job 5d4ad761666b). That's the expected behavior.
timestamps: "word" with result.content_type: "text/plain": validate_workflow reports it valid, but the run fails while saving with write() argument must be str, not list (job 0759bd1a541e). The schema description does document that JSON is required, so this doesn't count against this issue. The late, opaque error is filed separately as friction.
All three runs were deleted afterwards. The result matches expected:, so I'm closing this as verified.
Activity
dkackman commentedon Sep 26, 2026
triage: escalate — adds a new task argument (timestamps: segment|word) that switches transcribe_audio's result from text to JSON, so one command would have two return kinds; the returns:"json" / content_type validation and list_tasks' assessment grouping assume one per command, and word-level long-form Whisper is its own path. Needs sign-off on the shape (flag vs. a separate command) before a fix session builds it. (claude-opus-5-5 via anthropic)
dkackman commentedon Sep 27, 2026
Approved. Add an opt-in
timestamps: \"segment\" | \"word\"argument totranscribe_audio. When set, return a dict of chunks (start, end, text) instead of the plain string; default (unset) stays text, unchanged.On the triage concern: checked
register_command'sreturns=kinds (dw/tasks/task.py) —transcribe_audiois declaredreturns=\"artifact\", which imposes no fixed shape. The "one command, one return kind" assumption only bindsreturns=\"scalar\"/\"json\"commands (the assess probes,list_tasks's assessment grouping). So this doesn't need a new command, areturnsvariant, or any change toscalar_result_validation.py/content_types.py/list_tasks— it's contained toaudio_transcription.pyand itsget_taskdocstring/schema.One thing to get right in the fix:
return_timestamps=Trueis currently only requested past the 30s long-form threshold (_WHISPER_WINDOW_SECONDS).timestamps: \"word\"(or\"segment\") on a clip under 30s needs to request it explicitly too, rather than silently no-op'ing because the long-form branch didn't fire.Removing
owner:don+status:needs-approval, handing to the implementer.dkackman commentedon Sep 27, 2026
triage: work — Don approved the shape (opt-in
timestamps: "segment"|"word"ontranscribe_audio,returns="artifact", contained todw/tasks/audio_transcription.py+ its schema/docstring). Requestreturn_timestampsexplicitly under 30 s too, not only in the long-form branch; default output stays text. (claude-opus-5-5 via anthropic)dkackman commentedon Sep 27, 2026
Fixed and deployed by claude-sonnet-5 (anthropic).
transcribe_audio(dw/tasks/audio_transcription.py) now takes an opt-intimestampskwarg:"segment"requestsreturn_timestamps=True,"word"requestsreturn_timestamps="word"(works on both seq2seq Whisper and CTC pipes). Either returns{"text": ..., "chunks": [{"start", "end", "text"}, ...]}instead of the plain string; a step returning this shape must setresult.content_typetoapplication/json(readable via MCP'sget_output_text, which already accepts JSON). Unsettimestampsis unchanged — still plain text, and still only auto-requestsreturn_timestamps=Truepast the 30 s long-form threshold for Whisper.Per the approved shape: an explicit
timestampsrequest now fires regardless of clip length (covered bytest_timestamps_requested_under_thirty_seconds_too) rather than only past 30 s — the under-30s no-op Don flagged doesn't happen. An invalidtimestampsvalue raisesValueError. Docs updated indocs/TASKS.md's Speech Transcription section.Shipped as commit d3ecf60, merged to develop at 57c3fc6, deployed to lem (
develop @ 57c3fc6, healthy).Tests: 5 new cases in
tests/test_transcribe_audio.py(word/segment chunk shapes, under-30s explicit request, unset-stays-text, invalid-value rejection) plus the full existing suite, all passing;ruffclean on changed files.Suggested regression case (smoke suite): call
transcribe_audioon a short (<30s) known-speech clip withtimestamps: "word",result.content_type: "application/json"; expect the job's output to decode as{"text": <non-empty>, "chunks": [...]}with each chunk carrying numericstart/endand non-emptytext, and noreturn_timestamps-related error even though the clip is under 30s.dkackman commentedon Sep 27, 2026
Verified by claude-opus-5-5 (anthropic) against lem
develop @ 57c3fc6, over MCP only.get_task("transcribe_audio")lists the newtimestampsparameter. Its description says that"segment"/"word"returns{text, chunks}and needsresult.content_type: "application/json".I ran one inline workflow with 4 steps (job
a82464c58b9f, workspaceqa-ep73, succeeded in 13 s):asset:qa-cast/priya-voice.wav, about 6 s): returned{"text": "Priya, did the stashios go on all again?", "chunks": [...]}with 8 word chunks, each with numericstart/end(0.0–5.82) and non-emptytext. So the explicit request takes effect under 30 s instead of being silently ignored.{start: 0.0, end: 5.0, text: ...}.asset:qa-cast/ep55-episode.mp4): returned 10 segment chunks, 0.0–49.46 s, contiguous and on phrase boundaries. This is the long-form case from the original report.text/plainoutput (Priya. Did the stashios go on all again?), unchanged.I also checked two edge cases:
timestamps: "sentence"fails the job withtimestamps must be one of ('segment', 'word'), got 'sentence'(job5d4ad761666b). That's the expected behavior.timestamps: "word"withresult.content_type: "text/plain":validate_workflowreports it valid, but the run fails while saving withwrite() argument must be str, not list(job0759bd1a541e). The schema description does document that JSON is required, so this doesn't count against this issue. The late, opaque error is filed separately as friction.All three runs were deleted afterwards. The result matches
expected:, so I'm closing this as verified.