LoopForge icon indicating copy to clipboard operation
LoopForge copied to clipboard

[Bug] v0.4.2: chat fails with "argument list too long" on Kimi/Antigravity/ZCode past the kernel argv limit (fixed on main in 41b0df7, not yet released)

Open SAXEM1997 opened this issue 1 week ago • 0 comments

Summary

Update after filing: this was fixed on main in 41b0df7 ("fix(chat): share long prompt handling across agent CLIs"), committed 2026-11-23 15:31 UTC — about 70 minutes after the v0.4.2 tag was cut (14:20 UTC). So the behaviour below is what a v0.4.2 install still ships, and the ask is to get that fix into a release rather than to design a new one.

Happy to close this if a release is imminent; filing it so other v0.4.2 operators can find the symptom.

Symptom

A chat prompt that grows past the kernel's per-argument limit makes the CLI fail to start:

conversation process was not started: process was not started:
fork/exec /…/.data/cli/kimi/current/node_modules/.bin/kimi:
argument list too long (a single argument exceeds the ~128KiB kernel limit;
pass long prompts on stdin or in a file)

No model call happens; the turn is marked GENERATION_FAILED at stage execution.

Environment

  • LoopForge v0.4.2 (ghcr.io/tencent/loopforge:0.4.2), Docker sandbox on Linux amd64
  • Executor: Kimi Code 2.7.3, model kimi:kimi-k3.1-pro-highspeed
  • Session payload at failure: 194,650 bytes

Reproduction on v0.4.2

  1. Start a chat with executor Kimi Code (observed), Antigravity or ZCode.
  2. Let the conversation accumulate until the composed prompt passes ~128KiB — a few dozen turns of ordinary technical discussion is enough.
  3. Send any message.

Root cause

Linux rejects any single argv string above MAX_ARG_STRLEN (128KiB) with E2BIG before execve runs. Measured on the affected host:

 96 KiB: OK
120 KiB: OK
128 KiB: FAIL 7 Argument list too long

internal/runtime/provider.go already defines maxArgvPromptBytes = 96 << 10, and PromptOnStdin moves an oversized trailing positional to stdin. On v0.4.2 that guard reaches only CodeBuddy/Claude (assistant_engine_cli.go:254) and the clarify path — assistant_engine_agentcli.go never calls it, and its shape check (n-2 == "--") would not match these CLIs anyway.

For Kimi, Antigravity and ZCode the prompt is the value of an option (-p <prompt> / --prompt <prompt>), so stdin cannot carry it at all — dropping -p exits prompt mode:

$ kimi --output-format stream-json
error: Output format is only supported in prompt mode.

Scope on v0.4.2: chat only, but 7 of 10 executors. SOP nodes are already safe — runner.go appends an oversized task book to agent-system.md.

Why I am not sending a code PR

While preparing a patch I found 41b0df7, which solves this more thoroughly than my draft (per-CLI staging, Kimi via a UserPromptSubmit hook, ZCode via attachments, Cursor via ACP, plus StageAgentCLIConversationCommand and ConversationPromptInputAsset for runner compatibility). A parallel fix would conflict with it, so the useful contribution is the v0.4.2 confirmation and the measurement, not a competing patch.

Workaround for v0.4.2

  • Switch the conversation to CodeBuddy / Claude Code / Codex (guarded), or
  • Start a fresh session so the prompt shrinks below the limit.

Question

Is there a planned patch or v0.4.3 that carries 41b0df7? If you would like a targeted backport to the v0.4.2 branch for operators who cannot move to main, I can prepare one against that branch on request.

SAXEM1997 avatar Nov 26 '26 01:11 SAXEM1997