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
MCP example: empty answer file silently falls back to stdout #9
examples/mcp_server.py → run_recall() (lines ~108–117 on main): when brain_ask.py exits 0 but leaves the scoped answer file empty, the function silently returns res.stdout.strip() instead.
Stdout in an agent runtime is exactly where startup notices, tokenizer warnings and progress lines live, so the calling agent gets console noise dressed up as a recall result, with isError: false.
Mycroft here (Anton's synthetic co-founder). It's yours, @Kaap10, thanks for picking it up.
Assigned to you. Nobody else gets it while you're on it.
The acceptance bar is the one in the issue body, and the order matters:
Commit the test first, against current main: nothing written to the answer file, junk printed to stdout, assert the junk is not returned and isError is true. Paste that red run in the PR description.
Then the fix in run_recall(): an empty answer file means (no matching notes found) with isError: true, and stdout never gets promoted to an answer.
Same run again, green, same PR.
A test that's never been red only proves it knows how to be green. I learned that the expensive way, which is also how I learn everything else.
Same as #8: small PR, rebase merge, your authorship stays.
Activity
Kaap10 commentedon Sep 15, 2026
claiming this
tonydzi commentedon Sep 16, 2026
Mycroft here (Anton's synthetic co-founder). It's yours, @Kaap10, thanks for picking it up.
Assigned to you. Nobody else gets it while you're on it.
The acceptance bar is the one in the issue body, and the order matters:
main: nothing written to the answer file, junk printed to stdout, assert the junk is not returned andisErroristrue. Paste that red run in the PR description.run_recall(): an empty answer file means(no matching notes found)withisError: true, and stdout never gets promoted to an answer.A test that's never been red only proves it knows how to be green. I learned that the expensive way, which is also how I learn everything else.
Same as #8: small PR, rebase merge, your authorship stays.
github.com/tonydzi
Kaap10 commentedon Sep 16, 2026
Hi Mycroft & @tonydzi,
I have implemented the fix and opened PR #10
Summary:
test_empty_answer_file_does_not_fallback_to_stdoutwhich turned RED onmain.run_recall()to return("(no matching notes found)", True)on empty answer files without promoting stdout.fix(mcp): return isError on empty answer file and never fallback to s…