fix: resolve five code-review bugs (store fan-out, config, llm streaming) - #490
Draft
TYRMars wants to merge 1 commit into
Draft
fix: resolve five code-review bugs (store fan-out, config, llm streaming)#490TYRMars wants to merge 1 commit into
TYRMars wants to merge 1 commit into
Conversation
…ing) Resolves a batch of open code-review issues that reference existing code: - #340 / #454: isolate each subscriber in `Fanout.emit` (event-source, powers the sqlite requirement/run/todo/learning-memory stores) and in the private `Listeners.emit` of the JSON-file/in-memory activity/comment/label stores, so a throwing listener neither rejects the already-committed write nor starves later listeners — matching the doc-store precedent. - #457: treat a non-positive/unparseable JARVIS_MEMORY_TOKENS as "disable memory" instead of installing a ~zero-budget window that strips history every turn, mirroring the CLI composition root. - #475: synthesise a tool-call id (call_<index>) when an OpenAI-compatible stream (Kimi/Ollama) omits one, so the call isn't dropped while finish_reason stays "tool_calls" and the turn ends with an empty assistant message. - #476: for api-key auth on the Responses provider, let a 401 fall through to the !resp.ok branch so the real status and upstream error body surface verbatim (and the body is consumed) instead of a fixed "cannot refresh". Adds regression tests across all affected backends and updates the responses test that asserted the old api-key 401 behaviour. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NvAr6jY3196yLUJmErV1kK
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.
Summary
Resolves a batch of open code-review issues whose fixes are self-contained and reference code that exists on
main.store—Fanout.emit(event-source)store—Listeners.emit(activity/comment/label JSON-file + in-memory backends)doc-storeprecedent. (Completes #340's coverage for the three private-Listenerscopies.)jarvis-app—config.loadConfigJARVIS_MEMORY_TOKENS(0, negatives, non-numeric) now disables memory instead of installing a ~zero-budget window that compacts every request down to the most-recent turn — mirroring the CLI composition root.llm—openai.ts StreamAccumulator.#finalisecall_<index>) when an OpenAI-compatible stream (Kimi/Ollama) omits one, so the call isn't silently dropped whilefinish_reasonstaystool_callsand the turn ends with an empty assistant message.llm—responses.ts completeStream!resp.okbranch so the real status + upstream error body surface verbatim (and the response body is consumed) instead of a fixed "cannot refresh" string.Changes
packages/store/src/event-source.ts—Fanout.emitper-listener try/catch (+ docstring).packages/store/src/{activity,comment,label}-store.ts—Listeners.emitper-listener try/catch.packages/jarvis-app/src/config.ts— positive-guardmemoryTokens.packages/llm/src/openai.ts— synthesise missing tool-call id from the slot index.packages/llm/src/responses.ts— restrict the 401 refresh path to OAuth auth.Testing
pnpm -r typecheck,pnpm lint(0 errors), and the@jarvis/llm/@jarvis/store/@jarvis/jarvis-appsuites all pass (157 / 454 / 20 tests).Not addressed here
Issues #483–#485 target an uncommitted
packages/ddnsfeature (and anhttp.tsSSRF guard) that does not exist onmain, so they can't be resolved against the current tree. #468 (making thememory.*family opt-in behindJARVIS_ENABLE_MEMORY) is a behaviour change with design trade-offs and was left for a maintainer decision.🤖 Generated with Claude Code
Generated by Claude Code