You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Porting tickets need a prompt budget: COACTVWC's is 268 KB and Gemini returned nothing #3863
Found in #3754 (the CICS harness). Blocks the fresh-estate trials (#3803) on CICS programs.
What happened
The Gemini porting agent was given the COACTVWC ticket (CICS account view). It returned two empty answers and one sketch, scoring 1 of 10 scenarios. The whole prompt was about 268 KB: the ticket JSON, the source listings and the generated code it builds on. A batch ticket of normal size (CBACT04C) ported fine.
Where the size comes from (the COACTVWC ticket JSON, 87 KB)
section
bytes
note
facts.screen_bindings
49,788
only 2 facts. Each BMS map's full field inventory is embedded, and the generated *ScreenModel / view-model classes already carry it
facts.interface
10,859
6 facts
facts.cics_file_lineage
3,761
everything else
~23,000
rules, paragraphs, worklist, generated imports
The source listings (program plus copybooks) and the generated service come on top of this.
Proposal
Put a byte budget on the prompt (e.g. 64 KB for the ticket JSON, with a configurable total), and record in the ticket what was trimmed.
Reference, don't inline, facts the generated code already carries. For screen_bindings, keep the binding (map, field, the COBOL item it moves to or from) and point to the generated screen class for the field geometry (row, column, length, attributes).
Order the facts by need, so the budget trims the least useful ones first. Only a copybook the program actually references is listed.
Test: the COACTVWC ticket fits the budget and still names every field the program moves; a CICS port by the agent is attempted again with the harness (tests/tools/equivalence_cics.py).
i might have been using gemini subagents for another project and used the token window, please reassess, either way we could use more insight and this might be a great place to finally use tiktoken?
count_tokens uses tiktoken's o200k_base when it loads, and bytes/4 when it doesn't (offline or not installed).
A --ticket-budget (default 64k tokens) trims screen_bindings inventories to references to the generated screen classes, and records what was trimmed and the sizes.
A ticket within budget stays byte-identical.
port_runner prints prompt tokens and logs backend or HTTP errors instead of scoring them as empty ports.
Item 2, referencing other duplicated facts instead of inlining them, continues in #3930.
Activity
squid-protocol commentedon Sep 27, 2026
i might have been using gemini subagents for another project and used the token window, please reassess, either way we could use more insight and this might be a great place to finally use tiktoken?
#3863: the tiktoken fallback tests hold without tiktoken installed; t…
#3863: load tiktoken through a cached function, not module globals (C…
#3863: port tickets get a token budget (tiktoken when it loads, else …
squid-protocol commentedon Sep 27, 2026
Item 1 is merged in #3919:
count_tokensuses tiktoken's o200k_base when it loads, and bytes/4 when it doesn't (offline or not installed).--ticket-budget(default 64k tokens) trimsscreen_bindingsinventories to references to the generated screen classes, and records what was trimmed and the sizes.port_runnerprints prompt tokens and logs backend or HTTP errors instead of scoring them as empty ports.Item 2, referencing other duplicated facts instead of inlining them, continues in #3930.
🤖 Generated with Claude Code
#3791: an installed tiktoken that cannot load its encoding no longer …