Repository navigation
test: cover TaskHint hint selection (dispatch, embedding ranking, encode retries) - #36
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
…ncode retries (bug risk coverage gap)
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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
Closes the code scan coverage gap on
TaskHinthint retrieval intool_use_agent.py:choose_hintsdispatch, embedding top-n ranking, and the_encoderetry loop had no tests at all.New
tests/agents/test_tool_use_agent_hints.py(no network, no LLM):choose_hintsroutesllm/direct/embto the right helper with the right argument (goalvstask_name), and raisesValueErroron an unknown mode.choose_hints_embwith stubbed_encode/_similarityand similarities[0.1, 0.9, 0.5],top_n=2must return the two most similar hints, pinning theargsort()[0][-top_n:]index math (result is ascending by similarity, so the best hint comes last)._encoderetries therequests.postcall and succeeds on the third attempt, and re-raises after exhaustingmax_retries;time.sleepis monkeypatched so the retries are instant.Note:
pytestcollection of anything importingagentlab.llm.response_apifails in this environment onfrom anthropic.types import Completion(anthropic 1.6.0 removed it) — preexisting onmainand unrelated to this PR; tests were verified with that symbol shimmed in.Devin-Org: engineering
Link to Devin session: https://app.devin.ai/sessions/c037048a6e0c41cc9794ec6579c3ec0f
Open in Devin Desktop: https://app.devin.ai/desktop/session/c037048a6e0c41cc9794ec6579c3ec0f?variant=devin