Commit e4467e0
v0.14.4 apiproxy HOTFIX: stop poisoning tool_use input dict shape
Previous v0.14.3 replaced the entire tool_use.input dict with
{"_omc_compressed_input_marker": "..."}. The LLM then saw this in
conversation history and started copying the pattern when generating
new tool calls, producing InputValidationError on every Edit/Bash call.
Fix: rewrite_strings_recursive walks the input value and replaces only
LARGE STRING VALUES in place, preserving the original key names. So
{"file_path": "/x", "content": "<2KB>"} becomes
{"file_path": "/x", "content": "<omc:ref/>"} — recognizable as a
normal Write call by the LLM, no fake schema introduced.
Also dropped marker `preview` field for blocks >= 8KB. At that size the
LLM either needs the whole thing (expand-tool) or skips it; preview
adds zero decision-quality and ~200B per marker.
Verified in isolation against mock upstream:
- tool_use.input keeps `file_path` and `content` keys intact
- tool_result.content rewritten to marker
- last user message untouched (existing safety rule)
- upstream-visible payload preserves the assistant's tool-calling shape
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 019d2a1 commit e4467e0
1 file changed
Lines changed: 47 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
548 | 548 | | |
549 | 549 | | |
550 | 550 | | |
551 | | - | |
552 | | - | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
553 | 555 | | |
554 | | - | |
555 | | - | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
| 556 | + | |
568 | 557 | | |
569 | 558 | | |
570 | 559 | | |
| |||
582 | 571 | | |
583 | 572 | | |
584 | 573 | | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
585 | 610 | | |
586 | 611 | | |
587 | 612 | | |
| |||
614 | 639 | | |
615 | 640 | | |
616 | 641 | | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
617 | 648 | | |
618 | 649 | | |
619 | 650 | | |
620 | 651 | | |
621 | | - | |
622 | | - | |
623 | | - | |
624 | 652 | | |
625 | 653 | | |
626 | 654 | | |
| |||
0 commit comments