Skip to content

Reduce repeated Goal payloads during Turn admission - #9323

Open
loopx-agent wants to merge 2 commits into
mainfrom
codex/quiet-turn-rpc-20261123-124510
Open

loopx-agent wants to merge 2 commits into
mainfrom
codex/quiet-turn-rpc-20261123-124510

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Outcome

Python sent much of the same Goal source to the TypeScript owner during composition, context attachment and native read preparation. Those three operations now use the existing bounded, lossless codec when its encoded form is less than one third of the inline size. The receiver restores the original shape before signing, validation and projection edits. The 16 KiB to 1 MiB source window, decompression limit, existing capability transport and stored capture format are preserved.

Whole-operation measurements

Compared isolated copies of the same package at d33af49aaf, with the three production modules from 5468e4ed9e overlaid on the candidate. Each SQLite run read its selected requirements, then settled the original Turn and retried after losing its receipt. Each run recorded exactly one writeback and one spend.

Fixture CLI calls / RPC calls on both CLI bytes on both Bidirectional internal RPC bytes, base → candidate Offline RPC token estimate, base → candidate
One agent, warm, 25 selected requirements 8 / 205 68,666 1,964,753 → 1,776,517 439,619 → 431,706
One agent, cold, 100 requirements 8 / 205 88,519 1,966,410 → 1,778,175 439,586 → 431,677
Two registered agents, one applicable outcome, 25 requirements 7 / 203 65,462 2,019,095 → 1,825,872 455,281 → 445,811

The internal transfer fell about 9.6% in all three pairs. Token estimates use o200k_base and include volatile receipt identifiers. Three additional warm pairs without the RPC probe had median summed CLI wall times of 4.93 s on base and 4.03 s on the candidate. These are local observations under variable machine load. Provider billing and deployed host latency remain unmeasured.

A fresh guided first-Goal preview produced identical 46,247-byte output with one RPC on both revisions.

Counterexamples and checks

  • Applying the old byte-only threshold to ordinary English prose could nearly double the estimated RPC tokens for the encoded source. Five public documents, including Chinese, now take the inline path and produce identical outputs, bytes and estimated tokens through all three operations.
  • The new cross-runtime regression compares inline and packed output, exact large integers, native read plans and context additions. Ambiguous dual carriers and tampered signed data are rejected. Dense identifiers retain the inline form.
  • The base failed two call-count assertions after session policy moved into its typed owner. The revised tests check the lineage-only call for valid plans, the absence of full Goal carriers there, and the original refusal path.
  • 399 Python cases, 144 TypeScript cases and the TypeScript compiler passed. Goal-scoped change quality and standard premerge passed at the tested head, with 16 selected checks and six direct checks.

A revert returns the three callers to inline transport. This change adds no stored schema or user-facing options.

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

This branch has not been deployed

No deployments
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