shraga 0.1.64 → 0.1.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shraga",
3
- "version": "0.1.64",
3
+ "version": "0.1.65",
4
4
  "description": "The teammate you delegate coding to — a self-hostable, multi-user AI coding agent web UI (Claude Code, with a pluggable engine seam).",
5
5
  "type": "module",
6
6
  "main": "./src/index.ts",
@@ -225,6 +225,15 @@ export class ClaudeCodeEngine implements AgentEngine {
225
225
  sdkEnv.SHRAGA_USER_UID = sdkEnv.UNCLAW_USER_UID = opts.uid;
226
226
  if (opts.userEmail) sdkEnv.SHRAGA_USER_EMAIL = sdkEnv.UNCLAW_USER_EMAIL = opts.userEmail;
227
227
  sdkEnv.SHRAGA_SESSION_ID = sdkEnv.UNCLAW_SESSION_ID = opts.sessionId ?? '';
228
+ // Per-command wall-clock cap for the SDK's Bash tool. Without it a single unbounded command
229
+ // (e.g. `curl` with no `-m` against an SSE endpoint that streams nothing) eats the whole turn and
230
+ // the agent answers with "reads were interrupted". The model still sees `[exit 124]` + partial
231
+ // output and can adapt, and may ask for up to BASH_MAX_TIMEOUT_MS on a legitimately slow command.
232
+ // `??=` is not enough: the SDK treats a set-but-empty var as absent and silently falls back to
233
+ // its own 120s, so a blank host value must take our default too — only a real value wins.
234
+ const setIfBlank = (key: string, value: string) => { if (!sdkEnv[key]?.trim()) sdkEnv[key] = value; };
235
+ setIfBlank('BASH_DEFAULT_TIMEOUT_MS', process.env.AGENT_SHELL_TIMEOUT_MS?.trim() || '60000');
236
+ setIfBlank('BASH_MAX_TIMEOUT_MS', process.env.AGENT_SHELL_MAX_TIMEOUT_MS?.trim() || '600000');
228
237
  sdkEnv.INTERNAL_API_TOKEN = signInternalToken(opts.uid, opts.userEmail || 'unknown');
229
238
 
230
239
  const baseAllowed = config.allowedTools ?? DEFAULT_ALLOWED_TOOLS;