Skip to content

feat(evals): a scenario replay runs as the evaluation's owner - #451

Merged
TonsOfFun merged 1 commit into
mainfrom
feat/evaluation-replay-actor
Sep 13, 2026
Merged

feat(evals): a scenario replay runs as the evaluation's owner#451
TonsOfFun merged 1 commit into
mainfrom
feat/evaluation-replay-actor

Conversation

@TonsOfFun

Copy link
Copy Markdown
Contributor

Found while checking what main gives a host for 1.5.3: after #443 a dashboard run and an MCP call carry a caller, but a scenario evaluation replay still called Agent#test_execute with no actor:. Every tool a replay called ran unattributed, a host scope written correctly against Pundit answered empty, and the suite graded an agent that never saw a row — the same failure #443 closed for the other two surfaces.

Change

ScenarioEvaluationRunner#replay passes actor: replay_actor: the evaluation's owner (the user who owns the agent) when the install owns agents per user — the same rule the MCP facade applies to a key's owner. A multi-tenant install replays unattributed, because an account is who is billed, not who is allowed (Api::BaseController#agent_actor makes the same call); a host that wants per-user replays there already has ActionAgent.scenario_evaluation_adapter_resolver.

Testing

  • actionagent/test/scenario_evaluation_runner_test.rb (+2): the replay's actor is the owning user; unattributed when the install has no owner model.
  • bin/test actionagent/test/scenario_evaluation_runner_test.rb actionagent/test/scenario_evaluation_adapter_test.rb actionagent/test/evaluation_runner_service_test.rb actionagent/test/agent_authorization_test.rb — green.
  • bin/rubocop clean on the changed files. Docs: one paragraph in docs/framework/dashboard.md.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XMSRnSxYS9mRx1hSjytB9Z

The scenario runner handed Agent#test_execute no caller, so every tool a
replay called ran unattributed and a host scope answered empty — the suite
graded an agent that never saw a row. When agents are owned per user, a
replay now runs as the user who owns the evaluation, as a run over MCP runs
as the key's owner. A multi-tenant install still replays unattributed (an
account is who is billed, not who is allowed) unless a host adapter runs the
suite itself.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XMSRnSxYS9mRx1hSjytB9Z
@TonsOfFun
TonsOfFun merged commit 51c7feb into main Sep 13, 2026
15 of 16 checks passed
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