Skip to content

Restore corteza.tools after the instruction catalog tests - #207

Merged
TroyHernandez merged 1 commit into
mainfrom
test-isolation-corteza-tools
Sep 14, 2026
Merged

TroyHernandez merged 1 commit into
mainfrom
test-isolation-corteza-tools

Conversation

@TroyHernandez

Copy link
Copy Markdown
Contributor

Summary

  • test_instruction_catalog.R calls session_setup(tools = "run_r"), which writes the process-global corteza.tools option, and never put it back. test_mcp_handler.R then saw one tool and its subagent visibility check failed whenever the files ran in order, which is every CI run.
  • The block now saves the option and restores it in its on.exit, through base::options. tinytest masks options() inside a test file and re-applies at file end whatever the masked call saw as the prior value; session_setup() sets the option through base, so a masked restore was recorded as the change and undone. The comment in the test says so.
  • Test-only, no version bump.

Test plan

  • Before: catalog file then MCP handler file in one process leaves corteza.tools = "run_r" and the handler fails 1 of 42.
  • After: the option is NULL after the catalog file and the handler passes 42 of 42 in the same order.

session_setup(tools = "run_r") writes the process-global corteza.tools
option and nothing put it back, so test_mcp_handler.R saw one tool and
its subagent visibility assertion failed whenever the files ran in
order. The restore goes through base::options on purpose: tinytest
masks options() inside a test file and re-applies at file end whatever
the masked call saw as the prior value, and session_setup() sets the
option through base, invisible to that mask, so a masked restore was
recorded as the change and undone.
@TroyHernandez
TroyHernandez merged commit 5a50506 into main Sep 14, 2026
2 checks passed
@TroyHernandez
TroyHernandez deleted the test-isolation-corteza-tools branch September 14, 2026 02:03
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