Repository navigation
test: unit tests for agent_utils, most_basic, debug, visual and visualwebarena agents - #56
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
… and visualwebarena agents Co-Authored-By: Daniella Grimberg <daniella@cognition.ai>
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
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
Adds hermetic unit tests (123 tests, 5 new files, test-only — no
src/changes) for the small agents and agent helpers that had little or no coverage. The LLM is replaced by a fakeBaseModelArgsdataclass whosemake_model()returns a scripted callable, soretry/cost_tracker_decorator/asdict(chat_model_args)run for real. No network, browser, or API keys are used.tests/agents/test_agent_utils.pydraw_mouse_pointer/draw_click_indicator(pixel-level: changes stay inside the expected box, center gap untouched, input not mutated),draw_arrowheadgeometry,zoom_webpagewith aMagicMockpage (incl.<= 0→ValueError)tests/agents/test_most_basic_agent.pyParseErrorafter 3 tries,experiment_configtests/agents/test_debug_agent.pyAgentArgsbase defaults (set_benchmarkno-op,set_reproducibility_mode→NotImplementedError),DebugAgentArgs.set_benchmarkhtml toggle,obs_preprocessor(patched browsergym flatteners, deepcopy),get_actionvia patchedinputtests/agents/test_visual_agent.pymake_instructions(goal/chat/extra instructions; multi-user-message warning),History,Observation(tabs/error visibility, screenshot vs SoM selection +detail),MainPromptexamples +_parse_answer,VisualAgent.get_action(n_retryinference, busted-retry path, history carry-over),agent_configs,tmlr_config(get_vision_agent/get_som_agentdon't mutateBASE_FLAGS)tests/agents/test_visualwebarena_agent_unit.pyimage_data_to_uri(ndarray/bytes, alpha drop, bad format),parser, args naming +set_benchmarkdeepcopy, few-shot building for all 3 observation types (incl. embedded PNGs and the bad-formatValueError),get_actionmessage layout, tab string,PREVIOUS ACTION, SoM overlayCoverage (target modules)
agents/agent_utils.pyagents/most_basic_agent/most_basic_agent.pyagents/debug_agent.pyexcept AttributeErroraround an f-string assignment, which can't raise)agents/visual_agent/visual_agent.pyagents/visual_agent/visual_agent_prompts.pyagents/visualwebarena/agent.pyagents/agent_args.pyagents/generic_agent/tmlr_config.pyBugs / xfails
I didn't find any source bugs, so nothing is marked xfail. Some behavior is pinned as-is:
draw_*helpers always return an RGBA image, even when given RGB.DebugAgentArgs.set_benchmarkonly ever turnsuse_htmlon. It never turns it off.retryappends the assistant reply to the message list in place, soAgentInfo.chat_messages(andMostBasicAgent'sprompt_lengthstat) include the answer and any retry turns.Run
Coverage used a path-based
--cov=src/agentlab/agents. With module-name--cov=agentlab.agents.…flags, pytest-cov imports torch/numpy twice in this env and collection crashes.Devin-Org: engineering
Link to Devin session: https://devin-gtm.devinenterprise.com/sessions/aa5b999c334747bca5b49bbc615e638f
Open in Devin Desktop: https://devin-gtm.devinenterprise.com/desktop/session/aa5b999c334747bca5b49bbc615e638f?variant=devin
Requested by: @danigrim
Devin Review