Skip to content

fix(loop): detached run re-exec drops the loop group; fix verify-fail report and token parsing - #473

Merged
huichen merged 3 commits into
mainfrom
fix/loop-detached-run-and-token-parsing
Sep 3, 2026
Merged

huichen merged 3 commits into
mainfrom
fix/loop-detached-run-and-token-parsing

Conversation

@huichen

@huichen huichen commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

fix(loop): detached run re-exec drops the loop group; fix verify-fail report and token parsing

Three bugs found while driving a multi-worker solve via future loop:

  1. future loop run detached mode silently fails. The detached child
    re-execs current_exe and re-prepends only run, so the unified
    future binary dispatches to the unrelated one-shot future run command
    (which rejects --goal and exits instantly) while the parent prints a
    fake pid. Prepend the loop group when the executable stem is future;
    the standalone future-loop binary has no group layer and is unaffected.

  2. Verify-gate failure report misreports "error: completed". A verify-gate
    rejection ends the turn with terminal_state == "completed" and error ==
    None, so the supervisor failure report fell back to error.unwrap_or (terminal_state) and printed "error: completed". Report the failure kind
    instead, including the validator exit code for a verify rejection.

  3. Token accounting zeroes out on float/string token counts. The OpenAI-compat
    usage parser used a strict as_i64, so gateways that encode token counts
    as floats or numeric strings (observed for qwen-family models on the
    Future platform) silently reported every turn as 0 tokens. Parse
    i64 → f64 → numeric-string defensively, with a regression test.

Also bumps the skills submodule to pull in the matching SKILL.md
documentation (detached-run bug + token-burn watch + evidence truncation).

… report and token parsing

Three bugs found while driving a multi-worker solve via `future loop`:

1. `future loop run` detached mode silently fails. The detached child
   re-execs `current_exe` and re-prepends only `run`, so the unified
   `future` binary dispatches to the unrelated one-shot `future run` command
   (which rejects `--goal` and exits instantly) while the parent prints a
   fake pid. Prepend the `loop` group when the executable stem is `future`;
   the standalone `future-loop` binary has no group layer and is unaffected.

2. Verify-gate failure report misreports "error: completed". A verify-gate
   rejection ends the turn with terminal_state == "completed" and error ==
   None, so the supervisor failure report fell back to `error.unwrap_or
   (terminal_state)` and printed "error: completed". Report the failure kind
   instead, including the validator exit code for a verify rejection.

3. Token accounting zeroes out on float/string token counts. The OpenAI-compat
   usage parser used a strict `as_i64`, so gateways that encode token counts
   as floats or numeric strings (observed for qwen-family models on the
   Future platform) silently reported every turn as 0 tokens. Parse
   i64 → f64 → numeric-string defensively, with a regression test.

Also bumps the `skills` submodule to pull in the matching SKILL.md
documentation (detached-run bug + token-burn watch + evidence truncation).
@huichen
huichen force-pushed the fix/loop-detached-run-and-token-parsing branch from 47e8226 to b561a4e Compare September 3, 2026 02:38
@huichen
huichen enabled auto-merge (squash) September 3, 2026 02:42
@huichen
huichen merged commit 6e9b184 into main Sep 3, 2026
12 checks passed
@huichen
huichen deleted the fix/loop-detached-run-and-token-parsing branch September 3, 2026 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant