Gate unified exec TTY support behind a feature flag (#42718)

## What changed

- Add the stable, default-on `unified_exec_tty` feature.
- When disabled, omit `tty` from the `exec_command` tool schema and reject calls that explicitly request a TTY.
- Continue to support commands that omit `tty` or set it to `false`.

## Testing

- Add unified exec coverage for the disabled tool schema, explicit TTY rejection, and non-TTY command execution.

GitOrigin-RevId: c5934fe9db1423170b891c7ecd0188792cd03f42
This commit is contained in:
jif authored and copyberry committed 2026-09-04 10:22:43 +00:00
1 parent d13aeb77ea
commit 3c837e568c
6 files changed
+131 -1

No files matched your search

+5
View File
@@ -997,6 +997,10 @@ fn add_core_tool_sources(context: &CoreToolPlanContext<'_>, registry: &mut ToolR
{
registry.add(ExecCommandHandler::new(ExecCommandHandlerOptions {
allow_login_shell: any_environment_allows_login_shell(context.environments),
allow_tty: turn_context
.config
.features
.enabled(Feature::UnifiedExecTty),
exec_permission_approvals_enabled: false,
include_environment_id,
include_shell_parameter: unified_exec_should_include_shell_parameter(
@@ -1088,6 +1092,7 @@ fn add_shell_tools(context: &CoreToolPlanContext<'_>, registry: &mut ToolRegistr
let include_environment_id = matches!(environment_mode, ToolEnvironmentMode::Multiple);
let options = ExecCommandHandlerOptions {
allow_login_shell,
allow_tty: features.enabled(Feature::UnifiedExecTty),
exec_permission_approvals_enabled,
include_environment_id,
include_shell_parameter: unified_exec_should_include_shell_parameter(