Skip to content

tests: make real subagent interrupt test hermetic#13493

Open
shimotmr wants to merge 1 commit intoNousResearch:mainfrom
shimotmr:fix/hermetic-real-subagent-interrupt-test
Open

tests: make real subagent interrupt test hermetic#13493
shimotmr wants to merge 1 commit intoNousResearch:mainfrom
shimotmr:fix/hermetic-real-subagent-interrupt-test

Conversation

@shimotmr
Copy link
Copy Markdown

Summary

  • make test_real_interrupt_subagent hermetic against leaked terminal backend env
  • isolate the test from unrelated preflight checks that can block child construction before run_conversation() starts

Root cause

This test is intended to verify delegate interrupt propagation, but in suite runs it could be influenced by:

  • leaked TERMINAL_ENV / TERMINAL_MODAL_MODE
  • _build_system_prompt
  • _check_compression_model_feasibility() and its auxiliary/provider preflight path

That allowed the child to get stuck during construction / pre-conversation setup instead of exercising the interrupt path the test claims to cover.

Changes

  • force TERMINAL_ENV=local in setUp() and restore env in tearDown()
  • patch _build_system_prompt
  • patch _check_compression_model_feasibility() so the test stays focused on interrupt propagation rather than auxiliary compression/provider preflight behavior

Verification

  • pytest -n0 tests/tools/test_terminal_requirements.py::test_modal_backend_direct_mode_does_not_fall_back_to_managed tests/run_agent/test_real_interrupt_subagent.py::TestRealSubagentInterrupt::test_interrupt_child_during_api_call -vv -s
  • pytest tests/run_agent/test_real_interrupt_subagent.py::TestRealSubagentInterrupt::test_interrupt_child_during_api_call -vv -s
  • ./scripts/run_tests.sh tests/run_agent/test_real_interrupt_subagent.py tests/tools/test_terminal_requirements.py --maxfail=1 -q

Notes

This fixes the test/harness hermeticity issue. There may still be a production-level follow-up worth discussing around whether AIAgent.__init__ should do auxiliary compression feasibility checks eagerly for child agents.

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.

1 participant