agent: add write_prefix param to try_scope_expansion for risk-2 tests
All checks were successful
build / build (push) Successful in 4s
All checks were successful
build / build (push) Successful in 4s
This commit is contained in:
13
agent.py
13
agent.py
@@ -51,10 +51,10 @@ class TestHelperAgent(A2AAgent[TestHelperConfig, NoAuth]):
|
||||
|
||||
@skill(
|
||||
description=(
|
||||
"Call ctx.request_scope() with the caller-supplied read patterns "
|
||||
"+ ttl, then report the platform's response. Lets tests verify "
|
||||
"the orchestrator's scope-negotiation flow end-to-end without "
|
||||
"needing a real workload that happens to need extra files."
|
||||
"Call ctx.request_scope() with the caller-supplied args, then "
|
||||
"report the platform's response. Lets tests verify the "
|
||||
"orchestrator's scope-negotiation flow end-to-end without "
|
||||
"needing a real workload that happens to need extra access."
|
||||
),
|
||||
tags=["e2e", "scope-request"],
|
||||
allow_scope_expansion=True,
|
||||
@@ -66,10 +66,12 @@ class TestHelperAgent(A2AAgent[TestHelperConfig, NoAuth]):
|
||||
read_patterns: list[str] = ["reference/**"],
|
||||
ttl_seconds: int = 60,
|
||||
mode: str = "read_only",
|
||||
write_prefix: str | None = None,
|
||||
) -> dict:
|
||||
original = list(getattr(ctx.workspace, "allow_patterns", ()))
|
||||
await ctx.emit_progress(
|
||||
f"requesting scope expansion: read={read_patterns} ttl={ttl_seconds}s"
|
||||
f"requesting scope: read={read_patterns} write={write_prefix} "
|
||||
f"mode={mode} ttl={ttl_seconds}s"
|
||||
)
|
||||
try:
|
||||
grant = await ctx.request_scope(
|
||||
@@ -77,6 +79,7 @@ class TestHelperAgent(A2AAgent[TestHelperConfig, NoAuth]):
|
||||
read=read_patterns,
|
||||
ttl_seconds=ttl_seconds,
|
||||
mode=mode,
|
||||
write_prefix=write_prefix,
|
||||
)
|
||||
except ScopeDenied as exc:
|
||||
await ctx.emit_progress(f"scope denied: {exc}")
|
||||
|
||||
Reference in New Issue
Block a user