feat(web-search): worker-side search — capability, Tavily, streaming, v2 capture, greedy inference#2
Open
lightchainaidev wants to merge 17 commits into
Open
feat(web-search): worker-side search — capability, Tavily, streaming, v2 capture, greedy inference#2lightchainaidev wants to merge 17 commits into
lightchainaidev wants to merge 17 commits into
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move PublishMetadata call from stage 4.5 (pre-inference) to after stage 6 (response encrypted) so citations are delivered to the relay/UI after the answer, not before it. Search and prompt augmentation are unchanged — only the publish is deferred. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Switch TestStage5_StreamsChunks deltas from ["Hello, streaming world!", " Done."]
to ["Hello, streaming world!!", "Done"]: the first delta (24 bytes) hits the >=24
threshold and triggers a mid-stream flush (seq=1); the second delta (4 bytes) stays
below threshold and is flushed by the post-loop flushChunk() call (seq=2). Tighten
the assertion from require.NotEmpty to assert.Equal(t, []uint32{1,2}, seqs) so both
the threshold-flush and final-remainder-flush paths are explicitly exercised.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ture)
- Import pkg/searchaug; add toSearchaugSources() converter (search.Source → searchaug.Source)
- Stage 4.5: replace local buildSearchAugmentedPrompt with searchaug.BuildAugmentedPrompt;
carry searchSources as []searchaug.Source to stage 6
- Stage 6: wrap response in searchaug.EncodeResponse before encrypting; non-search jobs
get raw answer bytes (byte-identical to legacy format)
- sourcesMetadataJSON now accepts []searchaug.Source; relay-frame {type,sources} shape unchanged
- Remove local buildSearchAugmentedPrompt (template moved to pkg in Task 1)
- Remove TestBuildSearchAugmentedPrompt_FixedFormat (coverage moved to pkg)
- Add TestStage6_EmitsEnvelopeForSearchJob and TestStage6_RawAnswerForNonSearchJob
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…answer (v2 parity) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…2 envelope Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…) for reproducible re-execution
Add Options{Temperature:0, Seed:42} to all four Ollama request paths
(Generate, Chat, GenerateStream, ChatStream). Temperature is not
omitempty so the zero value is always serialised; omitting it lets
Ollama default to 0.8 (random sampling), causing worker/disputer
outputs to diverge and trigger false disputes.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace p.SearchEnabled (dispatcher-supplied flag) with searchaug.DecodePrompt so the search decision is authoritative in the encrypted blob. A decode error is now a hard stage-4 failure. Remove the dead SearchEnabled field from JobPayload. Update existing search tests to supply blobs built via searchaug.EncodePrompt(text, true) instead. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Part of the Web Search feature (v1 + v1.1 streaming + v2).
searchcapability;SEARCH_*/TAVILY_*config; Tavily client; stage 4.5 one-shot augmentation.completecarries the plain answer.{answer,searchContext}envelope into the response blob; history decodes envelopes.Depends on the
lightchain-shared-pkgweb-search PR (merge that first).🤖 Generated with Claude Code