Repository navigation
test(serve): a fired agent run sees the rendered template and no Write tools (#582) - #649
Merged
Merged
Conversation
…e tools (#582) tole serve runs against a mock OpenAI-compatible provider; a signed delivery fires an agent job, and the recorded model request must carry the job's prompt, the fenced UNTRUSTED WEBHOOK DATA with the rendered template, read_file and no write_file. Closes the gap left in part 2b, whose tests stopped at the claim.
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
1 task done
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.
What
An end-to-end test for #582:
tole servefires an agent job from a signed webhook delivery, and the test checks the model request that run sends.Why
The part 2b tests stopped at the claim, so nothing proved that the fenced template rendering reaches the fired run's prompt, or that the run is ReadOnly at the model boundary. This was the gap noted in part 2b (decision 3). The test is split from the
tole hookCLI PR (#648) to keep both PRs under ~900 lines.Changes
crates/tole-cli/tests/serve_hook_fire.rs:A new route
[hooks.agentic](cron_job = "writer",template = "commit: {head_commit.message}") and an agent jobwriterwithallow = ["write_file"].mock_provider(): a small OpenAI-compatible server on loopback. It records request bodies and answersdone, as SSE when the request asks for a stream and as JSON otherwise.spawn_with(base, mock)points serve at the mock throughTOLE_BASE_URL/TOLE_MODEL/TOLE_API_KEY.New test
a_fired_agent_run_sees_the_rendered_template_and_no_write_tools. The recorded request must contain:UNTRUSTED WEBHOOK DATAfence withcommit: bump version;read_file, and nowrite_file, although the job allows it.The run must then settle
ok.Testing
cargo fmt --all -- --checkcargo clippy -p tole-cli --all-targets --all-features -- -D warningscargo test -p tole-cli --test serve_hook_fire: 3 passed.cora review --no-llm --staged: no issues.cron/agent.rs, each restored afterwards; the test caught both:roster.plan_modeis forced to false (Write tools offered).