Skip to content

test(core/agent): add unit test that AgentRunInput.from_runtime_request copies resolved_integrations - #3737

Merged
Devesh36 merged 1 commit into
Tracer-Cloud:mainfrom
devthedevil:fix/agent-run-input-copies-resolved-integrations-test
Jul 5, 2026
Merged

Devesh36 merged 1 commit into
Tracer-Cloud:mainfrom
devthedevil:fix/agent-run-input-copies-resolved-integrations-test

Conversation

@devthedevil

Copy link
Copy Markdown
Contributor

Summary

Adds the missing test coverage called out in #3732: AgentRunInput.from_runtime_request already defensively copies resolved_integrations into a new top-level dict (resolved=dict(request.resolved_integrations or {})), but only the from_messages factory had a test proving the copy behavior. from_runtime_request was untested.

Change

  • tests/core/agent/test_run_io.py: added test_from_runtime_request_copies_resolved_integrations, which builds a fake runtime request with a resolved_integrations dict, calls from_runtime_request, then mutates the source dict by adding a new top-level key. It asserts run_input.resolved is unaffected, which only holds if the factory stored a copy rather than a reference.

No production code changed — core/agent/run_io.py already implements the copy correctly; this PR only closes the test gap.

Testing

uv run pytest tests/core/agent/test_run_io.py

The new test passes against the current implementation and would fail if the dict(...) copy in from_runtime_request were replaced with a direct reference assignment.

Closes #3732

@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Greptile code review

This repo uses Greptile for automated review. Before merge, aim for Confidence Score: 5/5 with zero unresolved review threads — see CONTRIBUTING.md.

Run a review — add a PR comment with:

@greptile review

Give it ~5-10 minutes (sometimes longer) for results, then fix feedback and re-trigger until you reach Confidence Score: 5/5.

Optional: automate with the greploop skill.

@greptile-apps

greptile-apps Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds test coverage for AgentRunInput.from_runtime_request copy behavior.

  • Adds a unit test for resolved_integrations top-level dict isolation.
  • Builds a fake runtime request and calls from_runtime_request directly.
  • Mutates the source dict after construction and checks run_input.resolved stays unchanged.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed test.
  • The test matches the current top-level copy behavior in from_runtime_request.

Important Files Changed

Filename Overview
tests/core/agent/test_run_io.py Adds a focused test for top-level resolved_integrations copy isolation in from_runtime_request.

Reviews (1): Last reviewed commit: "test(core/agent): add unit test that Age..." | Re-trigger Greptile

@Devesh36
Devesh36 merged commit 993600b into Tracer-Cloud:main Jul 5, 2026
18 checks passed
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

🎯 Bullseye. @devthedevil opened a PR, kept the vibes clean, and got it merged. Absolute cinema. 🎬


👋 Join us on Discord - OpenSRE : hang out, contribute, or hunt for features and issues. Everyone's welcome.

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.

test(core/agent): add unit test that AgentRunInput.from_runtime_request copies resolved_integrations

2 participants