Skip to content

test: cover ReproAgent trace-replay branches - #38

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1789678023-repro-agent-replay-tests
Open

devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1789678023-repro-agent-replay-tests

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Summary

Adds tests/agents/test_reproducibility_agent.py, the first test coverage for ReproAgent.get_action / ReproChatModel (code scan finding sfind-ed8a0ea, low severity). No production code changes.

Covered branches in reproducibility_agent.py:

  • old_chat_messages is None → returns (None, AgentInfo(markdown_page=...)) carrying the recorded err_msg instead of replaying.
  • len(old_chat_messages) == 2 with a recorded action → appends a reconstructed <action>{recorded_action}</action> assistant message (the legacy old-bug workaround) before replay; with no recorded action the discussion stays at 2 messages and ReproChatModel falls back to <action>None</action>.
  • Happy path: the recorded assistant answer is replayed through ReproChatModel, and the diff stats attached by _make_agent_stats show no drift.
  • ReproChatModel directly: returns old_messages[len(messages)], and the <action>None</action> fallback when the new discussion has caught up with the recorded one.

The agent is driven with a stub ExpResult/StepInfo (monkeypatched into the module) and CheatMiniWoBLLMArgs; GenericAgent.get_action is stubbed with a 2-message Discussion that it pushes through self.chat_llm, so no LLM or environment is involved.

Verified the tests fail when either branch is removed (if False: mutation of the None-check and of the len == 2 reconstruction).

Devin-Org: engineering

Link to Devin session: https://app.devin.ai/sessions/93845d3fb5e24f43b4009c7f7e97ec38
Open in Devin Desktop: https://app.devin.ai/desktop/session/93845d3fb5e24f43b4009c7f7e97ec38?variant=devin

@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants