feat(agy): offload large prompts to temp file for agy CLI - #400
Conversation
… UTF-16 index shifts
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 4, 2026, 11:53 AM ET / 15:53 UTC. ClawSweeper reviewWhat this changesThis PR lets the Antigravity CLI summarize oversized text prompts by placing the document payload in a restricted temporary file and passing its file URL to Merge readiness⛔ Blocked before merge - 3 items remain Keep open for maintainer product-direction review: the implementation is technically coherent and has real CLI proof, but it deliberately changes the documented default from rejecting large or sensitive Agy prompts to transient local-file storage. Priority: P2 Review scores
Verification
How this fits togetherSummarize formats extracted documents into tagged prompts and routes them to configured model CLIs. The Agy runner currently sends that prompt through flowchart LR
A[Extracted document] --> B[Prompt formatter]
B --> C[Agy CLI runner]
C --> D{Fits argv limit?}
D -->|Yes| E[Agy print request]
D -->|No| F[Restricted temporary document]
F --> E
E --> G[Summary output]
Decision needed
Why: Current main intentionally refuses these inputs and documentation directs users to another provider, so the new storage behavior is a product and privacy-policy choice rather than a mechanical defect. Before merge
Agent review detailsSecurityNone. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Preserve the documented refusal by default and, if temporary-file offloading is desired, introduce it behind a clearly documented opt-in after the privacy and compatibility policy is approved. Do we have a high-confidence way to reproduce the issue? Not applicable as a defect reproduction: current main intentionally rejects oversized Agy prompts, and the supplied terminal trace demonstrates the proposed new behavior on a 159 KB input. Is this the best way to solve the issue? Unclear: the implementation is narrow and proof-backed, but whether automatic storage is preferable to the current refusal requires an explicit maintainer privacy and compatibility decision. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c0ddab5b8531. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Live Unmocked Execution Diagnostic & Behavior ProofHere is the real, unmocked execution diagnostic running 1. Input Document Generation & Environment Setup$ python3 -c '
header = "# Comprehensive Report on Renewable Energy & Grid Integration\n\n"
body = "Solar and wind energy are leading global power grid decarbonization. Photovoltaic cells convert solar irradiance into electricity, while wind turbines harness kinetic energy. Storage technologies, particularly lithium-ion and flow batteries, play a critical role in balancing grid supply and demand.\n"
with open("/tmp/large-test-doc.txt", "w") as f:
f.write(header + body * 500)
'
$ ls -lh /tmp/large-test-doc.txt
-rw-r--r-- 1 mvance staff 159K Sep 3 09:40 /tmp/large-test-doc.txt2. Live Unmocked CLI Run$ summarize --cli agy --plain /tmp/large-test-doc.txt
The primary focus of the report centers on the transition toward sustainable power generation, highlighting that *Solar and wind energy are leading global power grid decarbonization.* This shift relies on specific energy conversion mechanisms across renewable infrastructure systems. Specifically, solar power leverages photovoltaic cells to convert solar irradiance directly into electricity, whereas wind turbines harness kinetic energy from atmospheric airflow.
To maintain operational stability across power networks, energy storage solutions serve as an essential component for bridging intermittent generation with real-time consumer requirements. Advanced battery architectures, including both lithium-ion and flow battery systems, facilitate continuous frequency regulation and load shifting. As outlined in the documentation, *Storage technologies, particularly lithium-ion and flow batteries, play a critical role in balancing grid supply and demand.*
The integration of these renewable resources and storage systems forms a cohesive framework for modern electrical grid modernization and carbon reduction goals. By combining continuous kinetic and photovoltaic generation with scalable storage, power utilities can effectively manage fluctuations in generation. Consequently, the synthesis of solar arrays, wind generation, and battery storage represents the fundamental baseline for successful large-scale grid decarbonization.
via model cli/agy
29s · cli/agy3. Real Agy Command & Temp File Inspection
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Autonomous triage update: the installed agy fails a synthetic readiness probe with The contributor's successful 159 KB trace is useful, but the remaining acceptance step is to verify instruction retention, output, and cleanup through the built CLI with a usable authenticated agy session, then decide whether automatic temporary-file offloading should become the default for oversized prompts. |
Summary
Follow-up replacement for #389. Offloads prompts exceeding platform argv limits (or command length limits on Windows) to a secure temporary file (
document.txt) with0o600permissions in the Antigravity (agy) CLI runner.Resolution of Precursor (#389) Concerns
prompt.txt, causingagyto meta-summarize the prompt template itself rather than executing the summarization task on the document. In this PR, only the raw document<content>payload is offloaded todocument.txt.--print: System instructions (<instructions>,<context>) and post-content formatting rules remain directly in the--printcommand argument (Summarize the content in file://.../document.txt), ensuringagyreceives system instructions in argv while reading the heavy payload from the file.lastIndexOfCaseInsensitive) on the original string rather than a lowercased copy, preventing UTF-16 length-changing characters (e.g.İU+0130) or literal<content>text in instructions from shifting index boundaries or corrupting payload extraction.Do not create or edit files. Do not include local file links or work-log narration.) whenallowToolsis false.finallyblocks on success, failure, or timeout.Empirical Behavior Proof
Executed
summarize --cli agy --plainagainst a 159 KB document payload (/tmp/large-test-doc.txt):Tests & Verification
tests/llm.cli.agy.test.tspassing 100%.mvance/summarize#19) with 0 unresolved issues.