Skip to content

Showcase rlm when context crosses 50% of compactAt - #633

Merged
cursor[bot] merged 4 commits into
release/v0.0.277from
cursor/rlm-context-showcase-4ffc
Aug 25, 2026
Merged

Showcase rlm when context crosses 50% of compactAt#633
cursor[bot] merged 4 commits into
release/v0.0.277from
cursor/rlm-context-showcase-4ffc

Conversation

@justrach

@justrach justrach commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Stacked on late-showcase (PR #631, rebased onto current 277 so x_search stays). Small first turns still hide rlm. When the existing session meter is actually large, the next catalog can carry the schema on the tail.

What the MGH post changed

Zhang / Li / Khattab treat RLM as a length-generalization decomposition space, not a default first-turn tool. Tool-call scaffolds cannot chunk near-infinite context; a for loop can. Their 32k/1-needle figure is an RL curriculum, not a production token floor. A naive fat-payload / first-slim trigger is the MCP case ADR 0030 already rejected.

So the size gate is the meter the Agent already has: effectiveContextTokens() ≥ 50% of provider.compactAt(). Not a second counter. Not 32k by default.

Showcase (markLoaded, schema on the tail, sPTC live):

  • --rlm / setFromCli(true) — immediate
  • a batch of ≥4 native host tools (read_file / codedb / bash / webfetch)
  • context ≥ 50% of compactAt
  • explicit load_tool_schemas tools=["rlm"]

MCP-only fan-out and first slim/fat payload do not showcase. /new and /clear hide a session-discovered showcase; --rlm sticks; --old resets.

GRAFF_RLM_CONTEXT overrides: unset = 50% of compactAt; 0/off disables; 1100 or 50% is a percent; 32k / 32768 is Zhang's curriculum as an opt-in floor.

Cache-head invariant

rlm never rides the Folded-native / load_tool_schemas listing (that would rewrite the tools head). renderRootTools before vs after showcase: head bytes identical, schema only on the tail. ADR 0011.

Do not splice system_note / shapes onto the always-on prefix.

ADR 0030 extended (same number as #631; no second 0030). Suite 1677 (277 was 1672; +1 late-showcase net, +4 context/knob/head).

Live SuperGrok (grok-4.6, OAuth, -p, --max-model-calls 2):

  • Small default: pong in 4.53s / 3570 in (512 cached) / 106 out / 1 call. Tools JSON has no rlm / llm_query. No rlm call.
  • Same prompt with GRAFF_RLM_CONTEXT=101 (threshold sim): pong in 6.60s / 3777 in / 252 out / 1 call. Catalog head (bashattempt_completion) byte-identical; rlm (+llm_query) appended; hosted x_search still last. No rlm call.

Tier 1: unit suite green at 1677; lines green; tuiguard hover flaked once (“sweep repainted 1 times”) and passed on retry.

Not in this PR: rewrite of #623 / #630 / #631 bodies.

Fold rlm even under --lean, keep it off the Folded-native listing
and the always-on prefix, and unfold on --rlm, a >=4 native batch,
or an explicit load. MCP fan-out does not showcase (Linear each()
footgun). sPTC stays wired for after unfold.
--rlm loads the schema onto the tail; catalogSkips stays true under
GRAFF_STABLE_CATALOG. Assert on the rendered JSON, not the skip flag.
Late-showcase hid rlm on small turns. This adds the missing half:
effectiveContextTokens crossing half of compactAt markLoads rlm onto
the catalog tail. GRAFF_RLM_CONTEXT overrides (percent, 32k floor, or
off). Tools-head bytes stay identical — rlm stays off the meta listing.

Zhang/MGH: RLM is for OOD-length decomposition, not a first-turn tool
and not a naive fat-payload trigger. 32k is their RL curriculum, opt-in.
The rlm listing skip comment pushed the file to 602. Collapse it so
tier 1 lines stays green.
@cursor
cursor Bot merged commit f0f5450 into release/v0.0.277 Aug 25, 2026
4 of 6 checks passed
@cursor
cursor Bot deleted the cursor/rlm-context-showcase-4ffc branch August 25, 2026 19:51
yermakoffivan pushed a commit to yermakoffivan/codegraff that referenced this pull request Aug 31, 2026
Double --suite inhouse with distilled verifiers from merged CodeGraff
PRs: hardlink pin (justrach#687), hosted x_search splice (justrach#632), first-turn MCP
skip (ADR 0035/0029), rlm showcase gate (justrach#633), codedb five-shot menu
(justrach#597), peer-channel resume (justrach#584). Same pattern as the first six —
buggy starter + SPEC + visible tests + hidden/ check. Not the live repo.
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.

2 participants