Repository navigation
fix(agent): build the hosted base with the session's own policy - #8576
Conversation
build() gave the hosted base a stand-in policy from Config::default(), which build_session then replaced. Building it logged "autonomy policy DISABLED" on every turn, even with the policy enabled. build_session now passes the policy its tools were built with, so no stand-in is made; other builder callers keep the config-derived policy.
|
Warning Review limit reached
This review includes 5 billable files and costs up to $1.25. Or wait 50 minutes for your next included review. View limit details
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Tiny Sweeper reviewReviewed head: Verdict: Ready for maintainer review · Priority: none Diagnostics and supporting detailsFull summaryPull request purpose (title): fix(agent): build the hosted base with the session's own policy. This pull request stops the session builder from manufacturing and then discarding a stand-in security policy whose log line falsely reported an autonomy policy as disabled on every agent turn. The builder gains a setter that lets a caller supply the session's own policy, `build` uses that policy for the hosted base when supplied and otherwise derives one from config exactly as before, and `build_session` passes its existing `Arc` through so the hosted base carries the same instance. Review snapshot
Completeness: Complete What changed`SessionHostBuilder` now carries an optional `security_policy` field alongside `runtime_config`, defaulted to `None` in the builder's `new`, with a new `pub(crate) security_policy` setter that stores the caller's `Arc`. In `build`, the hosted base takes that policy when set and otherwise falls back to the previous `SecurityPolicy::from_config` construction, so builder callers that never call the setter behave as before. `build_session` supplies `Arc::clone(&security)` — the same instance its tools were built with and the one it already installs afterwards — so in that path the only observable change is that the discarded stand-in, and its misleading "autonomy policy DISABLED" line, are no longer produced. A new test asserts the hosted base holds the caller's policy by pointer identity. The latest-push delta is unavailable: the review state lacks a trusted base-to-head diff, so this describes the whole pull request and not a comparison against a previously reviewed head. Features
TestsNo supported feature-to-test mapping was produced. Test execution is not inferred. FindingsNo active actionable findings. Before mergeNone. Agent review detailscritique
security
tests
commits
description
Evidence and run details
|
Resolve the one conflict in builder_build.rs with tinyhumansai#8576, which added an explicit security_policy override to the session builder. Keep the caller's policy when one is set; otherwise fall back to this branch's SecurityPolicy::for_config(&hosted_config), so the default policy still carries the account root.
Summary
Config::default()and then discarded.build_sessionnow hands the builder the policy its tools were built with, so no stand-in is made and the log reflects the session's real policy.Problem
SessionHostBuilder::build(builder_build.rs) gave the hosted base aSecurityPolicy::from_configbuilt fromruntime_config. That config is the default for production sessions, sofrom_configlogged the policy as disabled.build_session.rsthen replaced the hosted base with one carrying the session's own policy.Solution
pub(crate)SessionHostBuilder::security_policysetter. When it is set,builduses it for the hosted base; otherwise it builds the config-derived policy as before, so other builder callers are unchanged.build_sessionpassesArc::clone(&security), the instance its tools hold and the one it already installs afterwards.Arcas before. Only the discarded stand-in, and its log line, are gone.Submission Checklist
the_hosted_base_carries_the_policy_the_caller_builtpins that the built hosted base carries the caller's policy (Arc::ptr_eq). The unset path is covered by the existing builder tests.buildbranches are covered by builder tests. The one-linebuild_sessioncall runs in the existing session suites. CI's diff-cover decides.docs/TEST-COVERAGE-MATRIX.md.docs/RELEASE-MANUAL-SMOKE.md).Tests and red control
buildignores the setter, as on main. The new test fails at "the hosted base must carry the caller's policy, not a stand-in".Validation (cuttlefish, CF-W1-fix-027-1)
cargo fmt --checkpnpm rust:layoutartifacts/tiny_store_tests.rs784/750, pre-existing (fixed by #8560)cargo check --locked, core without / with security-module-D warningsagent::session_host::builder::builder_tests::session_definition_tests::the_hosted_base_carries_the_policy_the_caller_builtbuildignores the setter)agent::session_host::(one process)The 19
agent::session_host::failures are pre-existing and identical on main. This PR adds none.Impact
SecurityPolicyis built per session.Related
AI Authored PR Metadata (required for Codex/Linear PRs)
Linear Issue
Commit & Branch
fix/ts-e2e-027-no-placeholder-policyddc04c9089729f3cea26b1eccf0e071ce042ada2Validation Run
pnpm --filter openhuman-app format:check, no frontend changepnpm typecheck, no TypeScript changeValidation Blocked
command:N/Aerror:N/Aimpact:N/ABehavior Changes
Parity Contract
Duplicate / Superseded PR Handling