You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CI fix:
- _rules._matches_forbidden: yapf wanted the multi-or condition on one line
(it fits in 120 chars). Reformatted to match yapf output.
Critical:
- _wrapper._deny_code_result: replace custom _Outcome/_CodeExecutionResult
stub objects with real trpc_agent_sdk.types.CodeExecutionResult +
Outcome.OUTCOME_FAILED. The stub's _Outcome only had .name, so downstream
pipeline code (Part.from_code_execution_result, _openai_model) that reads
.outcome.value would AttributeError. trpc_agent_sdk.types pulls
google.genai.types (always installed with SDK core), NOT docker, so the
import stays dep-light. A fallback stub is kept only for the impossible
case where the SDK core itself is broken, and logs an error so the
misconfiguration is diagnosable.
Warning:
- _rules.ProcessRule._check_bash: strict_command_allowlist=True with empty
allowed_commands used to skip the whole allow-list check (fail-open),
letting rm/chmod slip through. Now every non-builtin command is flagged
HIGH (fail-closed), matching the semantic of "strict allow-list".
- _wrapper._scan_code_input: support dict-form code_blocks (with "code"/
"language" keys) in addition to object-form. Previously getattr on a
dict returned None/empty, silently skipping real code in dict blocks.
- _unsafe_local_code_executor.execute_code: move _pending_review_warning
initialization to the top of the function so it always has a defined
value regardless of which branch runs. Previously it was only assigned
inside the if/else branches, making later `if _pending_review_warning`
depend on branch ordering (fragile for refactors).
- _filter._before + _unsafe_local_code_executor: replace sys.stderr.write
with logging module (_logger.warning). Direct stderr writes pollute
captured stderr streams in CI / subprocess stdout-stderr separation, and
per-call stderr writes could be noisy. The audit log already records the
decision; the log line is the in-band fallback for operators.
Tests:
- test_wrapper: assert against real Outcome.OUTCOME_FAILED /
OUTCOME_OK (with .value access) so the test fails if a stub object is
ever reintroduced. _FakeInnerExecutor now returns a real
CodeExecutionResult too.
- test_rules: add test_strict_command_allowlist_empty_list_is_fail_closed
to lock in the fail-closed behavior for empty allowed_commands.
0 commit comments