feat: capture worker artifacts before teardown and carry native limits
All checks were successful
ci / validate (push) Successful in 2m39s
All checks were successful
ci / validate (push) Successful in 2m39s
Assistant: codex Assistant-Model: gpt-5.6-luna Assistant-Session: 01a07ff8-19d0-7820-b4d0-1353833cb7fc
This commit is contained in:
parent
44991600f3
commit
fb57c0228f
9 changed files with 159 additions and 3 deletions
|
|
@ -210,3 +210,19 @@ def test_cleanup_session_removes_only_generated_task_file() -> None:
|
|||
{"transport": transport, "task_file": "/sandbox/task.json", "generated_task_file": False}
|
||||
)
|
||||
transport.remove_file.assert_not_called()
|
||||
|
||||
|
||||
def test_profile_native_limits_are_carried_in_owned_task_file():
|
||||
from glas_harness.contract import ExecutionLimits
|
||||
profile = ProfileCatalog().resolve("harness.agent-dev-local@1.0.0")[0].model_copy(update={
|
||||
"limits":ExecutionLimits(max_budget_usd=.25,max_turns=3,timeout_seconds=30)})
|
||||
transport=MagicMock(spec=ExecutionTransport)
|
||||
transport.workspace="/sandbox"
|
||||
transport.git_head.return_value="a"*40
|
||||
rein=ReinAharness()
|
||||
with patch("glas_harness.reins.rein_aharness.transport_from_sandbox",return_value=transport):
|
||||
rein.start_session(profile,{"title":"task","description":"prompt asks for unlimited money"},SandboxHandle(sandbox_id="fixture",host="localhost"))
|
||||
assert transport.write_task_file.call_args.args[0]["max_budget_usd"] == .25
|
||||
assert transport.write_task_file.call_args.args[0]["max_turns"] == 3
|
||||
with pytest.raises(ValueError,match="Glas-generated"):
|
||||
rein.start_session(profile,{"task_file":"/untrusted.json"},object())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue