Datasets:

Modalities:
Text
Languages:
English
Size:
< 1K
ArXiv:
Libraries:
Datasets
Harbor
License:
File size: 925 Bytes
5873600
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Opt-in local Pi bash default only. Stanford sandbox tools are unaffected.
// CI_PI_BASH_TIMEOUT_SEC=120 supplies a timeout only when the model omitted it.
// Execution, errors, process-tree cleanup and explicit timeouts stay builtin.
export default function (pi) {
  const configured = process.env.CI_PI_BASH_TIMEOUT_SEC;
  if (configured === undefined || configured === '') return;
  const seconds = Number(configured);
  if (!Number.isFinite(seconds) || seconds <= 0 || seconds * 1000 > 2147483647) {
    throw new Error('CI_PI_BASH_TIMEOUT_SEC must be a positive finite builtin-supported duration');
  }
  pi.on('tool_call', event => {
    // Pi1.5 explicitly supports in-place mutation before builtin execution.
    // Do not repair invalid explicit arguments: normal builtin validation wins.
    if (event.toolName === 'bash' && event.input.timeout === undefined) {
      event.input.timeout = seconds;
    }
  });
}