typeclaw 0.47.0 → 0.47.2

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.
@@ -1265,14 +1265,14 @@ RUN chmod +x ${TYPECLAW_CX_SESSION_START_HOOK_PATH} ${TYPECLAW_CX_STOP_HOOK_PATH
1265
1265
  }
1266
1266
 
1267
1267
  // Shared-library runtime deps Chrome for Testing needs to launch on amd64
1268
- // Debian trixie (base of `oven/bun:1-slim`). `agent-browser install
1269
- // --with-deps` (v0.27.0) is supposed to install these but silently no-ops:
1270
- // its hardcoded list omits `libglib2.0-0t64`, so Chrome dies on launch
1271
- // with `libglib-2.0.so.0: cannot open shared object file` even though the
1272
- // binary download and `--with-deps` both exit 0. We install the full
1273
- // Playwright-tested chromium dep set here in Layer 2 so the bug doesn't
1274
- // recur if upstream omits another package; Layer 5 still calls
1275
- // `--with-deps` as a no-op-on-cache-hit backstop for future deps.
1268
+ // Debian trixie (base of `oven/bun:1-slim`). This layer is the ONLY thing
1269
+ // that installs them. `agent-browser install --with-deps` looks like it
1270
+ // would, but it cannot: it shells out to `sudo apt-get` and there is no
1271
+ // sudo in the image. Its hardcoded list also omits `libglib2.0-0t64`
1272
+ // (still true at 0.33.0), so even where apt worked Chrome would die on
1273
+ // launch with `libglib-2.0.so.0: cannot open shared object file`. We
1274
+ // install the full Playwright-tested chromium dep set here so the bug
1275
+ // doesn't recur if upstream omits another package.
1276
1276
  //
1277
1277
  // Package list mirrors Playwright's `debian13-x64` chromium deps in
1278
1278
  // nativeDeps.ts (https://github.com/microsoft/playwright). t64-suffixed
@@ -1488,7 +1488,7 @@ ${renderAgentBrowserInstallLayer(buildKit)}
1488
1488
 
1489
1489
  ${LAYER_4_5_AGENT_BROWSER_HEADED_WRAPPER}
1490
1490
 
1491
- ${renderChromeForTestingLayer(buildKit)}
1491
+ ${renderChromeForTestingLayer()}
1492
1492
 
1493
1493
  ${cloudflaredBlock}${claudeCodeBlock}${codexCliBlock}${renderEntrypointShimLayer()}
1494
1494
  ${renderGitAskPassLayer()}
@@ -1566,7 +1566,7 @@ ${renderAgentBrowserInstallLayer(true)}
1566
1566
 
1567
1567
  ${LAYER_4_5_AGENT_BROWSER_HEADED_WRAPPER}
1568
1568
 
1569
- ${renderChromeForTestingLayer(true)}
1569
+ ${renderChromeForTestingLayer()}
1570
1570
 
1571
1571
  ${renderEntrypointShimLayer()}
1572
1572
  ${renderGitAskPassLayer()}
@@ -1641,7 +1641,7 @@ RUN if [ "$TARGETARCH" = "arm64" ]; then \\
1641
1641
  const renderAgentBrowserInstallLayer = (buildKit: boolean): string =>
1642
1642
  `# Layer 4 (volatile): install agent-browser globally so it survives the
1643
1643
  # runtime bind-mount over /agent/node_modules.
1644
- RUN ${bunCacheMount(buildKit)}bun install -g agent-browser@^0.27.0`
1644
+ RUN ${bunCacheMount(buildKit)}bun install -g agent-browser@^0.33.0`
1645
1645
 
1646
1646
  // Layer 4.5: shim the agent-browser binary with a wrapper that calls
1647
1647
  // \`agent-browser close\` before \`open\`/\`goto\`/\`navigate\` when headed
@@ -1692,6 +1692,7 @@ RUN mv /usr/local/bin/agent-browser /usr/local/bin/agent-browser.real \\
1692
1692
  && cat > /usr/local/bin/agent-browser <<'TYPECLAW_AGENT_BROWSER_WRAPPER_EOF' \\
1693
1693
  && chmod +x /usr/local/bin/agent-browser
1694
1694
  #!/bin/sh
1695
+ # typeclaw-agent-browser-image-wrapper
1695
1696
  # typeclaw wrapper for agent-browser — see src/init/dockerfile.ts.
1696
1697
  set -e
1697
1698
  real="\${TYPECLAW_AGENT_BROWSER_REAL:-/usr/local/bin/agent-browser.real}"
@@ -1701,6 +1702,17 @@ real="\${TYPECLAW_AGENT_BROWSER_REAL:-/usr/local/bin/agent-browser.real}"
1701
1702
  if [ "\${_TYPECLAW_AGENT_BROWSER_HEADED_HANDLED:-}" = "1" ]; then
1702
1703
  exec "$real" "$@"
1703
1704
  fi
1705
+ # Match upstream precedence: an explicit --user-agent flag or non-empty
1706
+ # AGENT_BROWSER_USER_AGENT wins; otherwise use a current desktop Linux UA.
1707
+ has_user_agent=0
1708
+ for arg in "$@"; do
1709
+ case "$arg" in
1710
+ --user-agent|--user-agent=*) has_user_agent=1; break ;;
1711
+ esac
1712
+ done
1713
+ if [ -z "\${AGENT_BROWSER_USER_AGENT:-}" ] && [ "$has_user_agent" = "0" ]; then
1714
+ export AGENT_BROWSER_USER_AGENT='Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36'
1715
+ fi
1704
1716
  # Pre-close is only needed when the caller is requesting headed mode.
1705
1717
  # Match upstream's env_var_is_truthy contract (cli/src/flags.rs:183):
1706
1718
  # truthy = any non-empty value except case-insensitive "0", "false", "no".
@@ -1753,14 +1765,20 @@ TYPECLAW_AGENT_BROWSER_WRAPPER_EOF`
1753
1765
 
1754
1766
  // Layer 5: download the pinned Chrome for Testing build into
1755
1767
  // ~/.agent-browser/browsers/. NO cache mount on that path because the
1756
- // runtime needs the binary in the image. System shared libraries are
1757
- // already installed in Layer 2; --with-deps is a defense-in-depth backstop
1758
- // so a future agent-browser bump that adds new deps installs them
1759
- // automatically (near-no-op when Layer 2 already covers them).
1760
- const renderChromeForTestingLayer = (buildKit: boolean): string =>
1768
+ // runtime needs the binary in the image, and no apt cache mount either
1769
+ // because nothing in this layer runs apt.
1770
+ //
1771
+ // Deliberately NOT `--with-deps`. That flag shells out to `sudo apt-get`
1772
+ // and there is no sudo in the image, so it could never install anything
1773
+ // here. Through 0.27.x it failed silently and still exited 0, which is
1774
+ // why it looked like a working backstop; 0.33.0 made it fail-closed
1775
+ // ("fails if deps fail" in its own --help) and turned that dead no-op
1776
+ // into a hard build failure. Chrome's shared libraries are installed for
1777
+ // real in Layer 2.
1778
+ const renderChromeForTestingLayer = (): string =>
1761
1779
  `# Layer 5 (heavy, amd64 only): Chrome for Testing download.
1762
- RUN ${aptCacheMount(buildKit)}if [ "$TARGETARCH" != "arm64" ]; then \\
1763
- agent-browser install --with-deps; \\
1780
+ RUN if [ "$TARGETARCH" != "arm64" ]; then \\
1781
+ agent-browser install; \\
1764
1782
  fi`
1765
1783
 
1766
1784
  function defaultConfig(): DockerfileConfig {
package/src/init/index.ts CHANGED
@@ -769,7 +769,7 @@ function addCustomModel(
769
769
  // Must match the Dockerfile Layer 4 global install (dockerfile.ts); they are
770
770
  // two installs of the same CLI and a skew is silent. Enforced by a guard test
771
771
  // in packagejson.test.ts.
772
- export const AGENT_BROWSER_VERSION = '^0.27.0'
772
+ export const AGENT_BROWSER_VERSION = '^0.33.0'
773
773
  function buildPackageJson(root: string, name: string, platform: NodeJS.Platform): Record<string, unknown> {
774
774
  return {
775
775
  name,
@@ -10,9 +10,9 @@ GitHub renders normal Markdown in issues, PRs, discussions, and review comments.
10
10
  - For PR review threads, keep `thread` set to reply in-place. Omit `thread` for a top-level PR/issue comment.
11
11
  - When a review comment **you authored** has been addressed, resolve its thread by replying with `channel_reply({ …, resolve_review_thread: true })` — see "Resolving review threads you authored" below. The base principle is **whoever opened the thread closes it**: you resolve only the threads you started, never a human's (the runtime enforces this).
12
12
 
13
- ## Mid-turn status replies need `continue: true`
13
+ ## Mid-turn status replies need `more_work_this_turn: true`
14
14
 
15
- A successful `channel_reply` ends your turn by default — the runtime stops the model right after the reply lands. That is correct for a final answer, but it will **silently truncate** a turn that still has work to do. If you post a status line like "Reviewing now, I'll be back with findings" and then expect to keep working (fetch the diff, spawn the reviewer, post the review) in the **same** turn, you must call `channel_reply({ text: "…", continue: true })`. Without `continue: true`, the turn ends at that status reply and the review never runs. Reserve `continue: true` for genuine multi-step turns; the final reply that wraps up the turn omits it.
15
+ A successful `channel_reply` ends your turn by default — the runtime stops the model right after the reply lands. That is correct for a final answer, but it will **silently truncate** a turn that still has work to do. If you post a status line like "Reviewing now, I'll be back with findings" and then expect to keep working (fetch the diff, spawn the reviewer, post the review) in the **same** turn, you must call `channel_reply({ text: "…", more_work_this_turn: true })`. Without `more_work_this_turn: true`, the turn ends at that status reply and the review never runs. Reserve `more_work_this_turn: true` for genuine multi-step turns; the final reply that wraps up the turn sets `more_work_this_turn: false`. The field is required — every `channel_reply` must set it explicitly, so never omit it.
16
16
 
17
17
  ## Inbound triage — do this first, every time
18
18
 
@@ -259,10 +259,10 @@ If the author merely **replied** without pushing (e.g. "this is intentional beca
259
259
  Once you have verified the fix, **acknowledge and resolve in one call**: pass `resolve_review_thread: true` to your `channel_reply`. The runtime resolves the thread you're replying in **before** it posts your acknowledgement, then posts the reply:
260
260
 
261
261
  ```
262
- channel_reply({ text: "Verified — the fix addresses the concern. Thanks!", resolve_review_thread: true })
262
+ channel_reply({ text: "Verified — the fix addresses the concern. Thanks!", more_work_this_turn: false, resolve_review_thread: true })
263
263
  ```
264
264
 
265
- This is the correct path and it removes a footgun. A bare `channel_reply` ends your turn the moment it lands, so a resolve attempted _after_ the acknowledgement would never run — the thread would stay open even though you "handled" it. The flag resolves first, so a normal final reply still closes the thread. You do **not** need `continue: true` for this: resolution happens inside the same call, before the turn ends.
265
+ This is the correct path and it removes a footgun. A bare `channel_reply` ends your turn the moment it lands, so a resolve attempted _after_ the acknowledgement would never run — the thread would stay open even though you "handled" it. The flag resolves first, so a normal final reply still closes the thread. You do **not** need `more_work_this_turn: true` for this: resolution happens inside the same call, before the turn ends.
266
266
 
267
267
  Two guarantees make the flag safe to use as your default:
268
268
 
@@ -89,7 +89,7 @@ To depend on a workspace package from the **agent root** (e.g. so cron `exec` jo
89
89
  {
90
90
  "dependencies": {
91
91
  "typeclaw": "file:../typeclaw",
92
- "agent-browser": "^0.26.0",
92
+ "agent-browser": "^0.33.0",
93
93
  "my-utility": "workspace:*"
94
94
  }
95
95
  }
@@ -43,7 +43,7 @@ State the success condition as something operator can check with `bash` — file
43
43
 
44
44
  Then stay responsive. When the completion `<system-reminder>` lands, weave operator's report into your next reply (in a channel session, surface it via `channel_reply`/`channel_send` — plain text is invisible there).
45
45
 
46
- If the `subagent.spawn.operator` gate denies (you're not owner/trusted tier), you can't delegate — fall back to doing the loop yourself, but apply the mechanics below to do it cleanly.
46
+ If the spawn is denied (no `subagent.spawn` grant at all), you can't delegate — fall back to doing the loop yourself, but apply the mechanics below to do it cleanly.
47
47
 
48
48
  ## Mechanics operator should use (and you, if you can't delegate)
49
49