Skip to content

[frontier W49] Script-mode context economy: executed scripts replace per-tool-call turns (cc Code-Mode analog) #450

Backlog

Description

@dahai80

Source: fusion#18 W49 tech radar. Evidence: Claude Code v2.1.330-334 ships and hardens "Code Mode" - a script runtime where the agent writes one script that performs many tool operations, so tool-call overhead and per-call context stop scaling with task length (changelog: Code Mode subagent stalls fixed, script tool-calls excluded from context size, script error surfacing).

Gap statement: fusion-code has WorkflowTool (workflow scripts, gated) but the INTERACTIVE loop still burns context per tool call; no script-mode path for long tool chains.

Target: on the bench#91 external suite's longest-horizon tasks, script-mode sessions complete with >=30% less context consumption at equal or better pass rate; measured, not asserted.

Non-goals: not replacing the permission model; scripts run under the same gates.

Refs fusion#18 axis A/E; bench#91.

Activity

  1. dahai80 commented on Dec 2, 2026

    @dahai80
    OwnerAuthor

    Implementation slice landed (PR #465): the script runtime is REPL mode (#436/#438) — one JavaScript call batches many tool ops, intermediate results stay in-script, only the final expression enters context (the Code-Mode analog). New: BENCH_REPL_MODE=1 arm on the external bench runner exports FUSION_CODE_REPL=1 (REPL_ONLY_TOOLS hides the primitive tools), enabling the two-arm measurement protocol documented in benchmarks/tb2/README.md — baseline vs script-mode tok_in + reward on the A20 longest-horizon tasks. Acceptance number (>=30% context reduction at equal/better pass rate) lands with the next A20 window runs; issue stays open until measured.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions