Skip to content

Porting tickets need a prompt budget: COACTVWC's is 268 KB and Gemini returned nothing #3863

Closed

Description

@squid-protocol

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

  1. 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.
  2. 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).
  3. Order the facts by need, so the budget trims the least useful ones first. Only a copybook the program actually references is listed.
  4. 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).

🤖 Generated with Claude Code

https://claude.ai/code/session_017ZsVaAkb86P5r5JXDC2Y9g

Activity

  1. added
    enhancement
    on Sep 27, 2026
  2. squid-protocol commented on Sep 27, 2026

    @squid-protocol
    OwnerAuthor

    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?

  3. added 3 commits that reference this issue on Sep 27, 2026
  4. added
    status: pending-release
    on Sep 27, 2026
  5. squid-protocol commented on Sep 27, 2026

    @squid-protocol
    OwnerAuthor

    Item 1 is merged in #3919:

    • 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.

    🤖 Generated with Claude Code

  6. added a commit that references this issue on Oct 1, 2026
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

    enhancementstatus: pending-release

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions