Conversation
7a56ca1 to
140d32c
Compare
Encourage Claude to resurface previously-logged topics when new context emerges. Standard workflow still applies - re-present full topic with changes noted, get approval before updating the draft.
140d32c to
563bcb8
Compare
leeovery
added a commit
that referenced
this pull request
Apr 20, 2026
…fig null unset Three small correctness/style fixes bundled: - OpenAIProvider.embed() now throws a descriptive error if OpenAI returns an empty data array instead of a cryptic TypeError reading res.data[0].embedding. Unlikely in practice but costs nothing to guard. (deferred #13) - OpenAIProvider.embedBatch() no longer mutates res.data in place. Spread before sort. (deferred #12) - config.loadConfig() now treats explicit null in system/project config as an unset sentinel, letting a project config clear a system-level default. (deferred #14) Closes deferred-issues #12, #13, #14.
leeovery
added a commit
that referenced
this pull request
Apr 21, 2026
embedBatch assumed res.data.length === requested length. If OpenAI returned fewer rows (rare but not impossible — partial availability, certain rate-limit interactions), results[offset + i] for missing indices stayed undefined. Downstream: doc.embedding = undefined, Orama inserted the chunk with no embedding field, chunk silently degraded to keyword-only with no warning. embed() had this guard already (deferred-issue #13); embedBatch was missed. Added length check after each _fetch in both branches of embedBatch: - Single-batch (texts.length <= MAX_BATCH_SIZE): validate res.data.length === texts.length. - Chunked (>MAX_BATCH_SIZE): validate per slice. Error message includes requested vs received counts and chunk offset when applicable. Tests: two new cases in test-knowledge-openai.cjs — short response (2 rows for 3 inputs) and missing data array both assert rejection with /response length mismatch/ pattern. Confirmed both fail on pre-fix code by reverting the guards.
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.
Encourage Claude to pause and resurface previously-logged topics when
new context emerges during draft planning. This ensures information
discovered later in reference material doesn't silently slip past
topics that could be affected.