MCPcopy Create free account
hub / github.com/codehamr/codehamr / TestBashTimeoutCappedAtOneHour

Function TestBashTimeoutCappedAtOneHour

internal/tools/bash_test.go:146–160  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

144 }
145}
146
147func TestBashTimeoutCappedAtOneHour(t *testing.T) {
148 // 999999s must clamp to 3600. Can't sleep an hour to prove it, so a short
149 // command just has to complete quickly: no overflow, no panic.
150 call := chmctx.ToolCall{
151 ID: "t2", Name: "bash",
152 Arguments: map[string]any{
153 "cmd": "echo clamped",
154 "timeout_seconds": float64(999999),
155 },
156 }
157 msg := Execute(context.Background(), call)
158 if !strings.Contains(msg.Content, "clamped") {
159 t.Fatalf("expected echo output: %q", msg.Content)
160 }
161}
162
163// TestBashTimeoutOverflowClamped: extreme floats must be clamped BEFORE the

Callers

nothing calls this directly

Calls 1

ExecuteFunction · 0.85

Tested by

no test coverage detected