Repository navigation
1.5.21: Say in the per-call log line which "no subtitles" answer a call gave - #79
Merged
Merged
Conversation
A get_transcript or get_raw_subtitles call that ends with not_found now logs answer=list, none, stt_failed or unread in its "MCP tool call" line. Before, the line said only reason=not_found, so an operator could not tell a track list (expected by ADR 006) from a real failure. Other calls have no answer field. Metrics and caller texts do not change. Closes #64 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
samson-art
marked this pull request as ready for review
October 6, 2026 18:52
…btitles-answer # Conflicts: # CHANGELOG.md
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.
Closes #64
What and why
Since 1.5.13 (ADR 006), a
get_transcriptorget_raw_subtitlescall can end withreason=not_foundin several ways. The "MCP tool call" log line does not say which. So an operator cannot tell a track list, which ADR 006 expects, from a real failure. In the last 7 days,get_transcripthad 190not_foundanswers, and the logs cannot split them.Now the line of such a call has an
answerfield with one fixed value:list: the video lists tracks, and the caller got the list.none: the video lists no tracks, and speech-to-text did not run.stt_failed: speech-to-text ran and produced nothing.unread: the list of tracks could not be read. This value is not in the issue. It was added in the interview, so that "could not read" does not count as "no tracks".If more than one is true, the first in this order wins:
stt_failed,unread,list,none. A call by name that misses while the video lists other tracks also logslist. Theexplicitfield on the same line separates the two paths.Plan
Files that change
src/errors.ts: theNoSubtitlesAnswertype, and an optionalansweronNotFoundError(4th constructor argument). It is not part ofdetails, so the REST body and the track hint do not change.src/validation.ts:throwNoSubtitlesError(the one throw site for both paths) setsanswer.src/mcp-core.ts:withToolErrorHandlingcopiesanswerinto the log line only when it is set.CHANGELOG.md: an Added entry.Order of work
validation.test.ts, and a log-line test inmcp-core.test.ts. All red.Risks
NotFoundErrorhas about 6 callers. The new argument is optional and last, so no caller changes.Verified
make check-no-smoke: format, lint, typecheck, build green. Jest: 17 suites, 493 tests passed.validation.test.ts.mcp-core.test.tsdid not compile without the 4th argument.listbeforestt_failed→answer=stt_failed when speech-to-text ran and produced nothing, even beside a list.unread→none→answer=unread when the track list could not be read.none→list→answer=none when the video lists no tracks and speech-to-text did not run.err.answernot copied →should name the kind of "no subtitles" answer in the log line, and only there (#64).Not verified
Not in scope
get_playlist_transcripts: an empty selection is a success (outcome=ok), so this call never gets a "no subtitles" error. The issue lists it, but no change is needed.After merge
reason=not_foundfromget_transcript/get_raw_subtitlesthat went through the subtitle path hasanswer. Count the lines by value.🤖 Generated with Claude Code