Ignore project instructions for untrusted projects (#39837)

## What changed

- Skip project-scoped `AGENTS.md` discovery when the active project is untrusted, while preserving user-level instructions.
- Include the active project trust level in the instruction cache key so runtime trust changes reload the applicable instructions.
- Preserve updated project trust metadata during runtime configuration refreshes.

## Testing

Add coverage for initially untrusted projects and for switching between trusted and untrusted states at runtime.

GitOrigin-RevId: 284bf7693943f585013fb5fe4b6aa3309bc50cf3
This commit is contained in:
Dylan Hurd
2026-08-21 02:33:50 +00:00
committed by copyberry
parent d8ec270183
commit bd19459358
4 changed files with 131 additions and 0 deletions
+1
View File
@@ -1752,6 +1752,7 @@ impl Session {
let previous_config = notify_config_contributors
.then(|| self.build_effective_session_config(&state.session_configuration));
let mut config = (*state.session_configuration.original_config_do_not_use).clone();
config.active_project = next_config.active_project.clone();
config.config_layer_stack = config
.config_layer_stack
.with_user_layer_from(&next_config.config_layer_stack);