fix(ai): repair native-harness bench — 3-tuple preflight + PTY-mirror stub

First functional bench run crashed 0/3 on two latent bench-only bugs:
(1) the Phase-4 token-count change made complete_with_tools return
(text, calls, usage), but the bench preflight still unpacked 2 values;
(2) make_bridge never stubbed _send_sbx_input, so the PTY-mirror
visibility feature hit ws=None and raised AttributeError on every tool
call. Stub it to capture mirrored lines for --verbose.

After the fix: 2/3 pass (write+read, script+run). mkdir+list still
fails — local-backend run_shell CWD divergence + 3B model churn, not a
working-memory regression.

Sprint: native-harness-working-memory (bench) — see also 46e5620, dc6317f, c83abbe

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
leetcrypt
2026-06-27 10:16:30 -07:00
parent 2b66da71c5
commit b55743bada
+6 -1
View File
@@ -97,6 +97,11 @@ def make_bridge(provider, workdir: str):
b._chat.append("[inject] " + " ; ".join(cmds))
b._inject = cap_inject
async def cap_sbx_input(ws, data): # PTY-mirror frames — broker-only in prod
b._chat.append("[pty] " + data.decode(errors="replace").rstrip("\n"))
b._send_sbx_input = cap_sbx_input
return b
@@ -157,7 +162,7 @@ async def main() -> int:
print("[preflight] probing tool support…", flush=True)
t0 = time.monotonic()
try:
text, calls = await asyncio.to_thread(
text, calls, _usage = await asyncio.to_thread(
provider.complete_with_tools,
"You are a test.",
[{"role": "user", "content": "Call run_shell to echo hi."}],