mirror of
https://github.com/vxcontrol/pentagi.git
synced 2026-07-20 23:57:11 -04:00
[PR #261] [MERGED] feat: add TERMINAL_TOOL_TIMEOUT configuration #275
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/vxcontrol/pentagi/pull/261
Author: @mason5052
Created: 4/15/2026
Status: ✅ Merged
Merged: 4/21/2026
Merged by: @asdek
Base:
feature/next-release← Head:codex/issue-256-terminal-timeout📝 Commits (2)
86d7666feat: add configurable terminal tool timeout1d6da34fix: clamp oversized terminal timeout📊 Changes
16 files changed (+213 additions, -30 deletions)
View changed files
📝
.env.example(+4 -0)📝
README.md(+1 -0)📝
backend/cmd/ftester/mocks/tools.go(+1 -1)📝
backend/cmd/ftester/worker/executor.go(+3 -0)📝
backend/cmd/installer/wizard/controller/controller.go(+6 -0)📝
backend/cmd/installer/wizard/locale/locale.go(+14 -2)📝
backend/cmd/installer/wizard/models/server_settings_form.go(+26 -0)📝
backend/docs/config.md(+17 -0)📝
backend/pkg/config/config.go(+1 -0)📝
backend/pkg/config/config_test.go(+26 -1)📝
backend/pkg/tools/args.go(+1 -1)📝
backend/pkg/tools/registry.go(+3 -2)📝
backend/pkg/tools/terminal.go(+50 -23)📝
backend/pkg/tools/terminal_test.go(+51 -0)📝
backend/pkg/tools/tools.go(+8 -0)📝
docker-compose.yml(+1 -0)📄 Description
Summary
TERMINAL_TOOL_TIMEOUTas a configurable environment variable with Docker Compose, config, installer, and docs supporttimeout=0Problem
Issue #256 reports that long-running terminal commands can time out with no operator-side configuration to change the default behavior.
At the moment, terminal execution falls back to a hardcoded default timeout in the backend. Users running PentAGI through Docker Compose can adjust
HTTP_CLIENT_TIMEOUT, but there is no equivalent setting for terminal tool execution.Solution
Add a new
TERMINAL_TOOL_TIMEOUTsetting and thread it through the relevant execution paths.backend/pkg/configparsesTERMINAL_TOOL_TIMEOUTwith a default of600docker-compose.ymland.env.exampleexpose the variable for Compose-based deploymentstimeout=00is supported as "no server-side default timeout"This keeps explicit tool timeouts intact while giving operators a configuration-level fallback for long-running commands.
User Impact
Operators can now increase the default terminal execution window for long-running commands without patching the codebase. Compose users can set
TERMINAL_TOOL_TIMEOUTin.env, and installer users can change the same setting from the server settings flow.Closes #256.
Test Plan
go test ./pkg/config ./pkg/tools/...go test ./cmd/ftester/... ./cmd/installer/wizard/controller ./cmd/installer/wizard/models ./cmd/installer/wizard/localegofmt -won changed Go filesgit diff --checkNotes
go test ./cmd/installer/wizard/...still hits pre-existing Windows host issues incmd/installer/wizard/terminalbecause that package expects POSIX commands such asecho,sh, andcatto be available inPATH. This PR does not modify that package.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.