Skip to content

Multi-KB --goal text is silently truncated by canonical-mode tty (MAX_CANON) at launch #57

Description

@scgopi

Reported by a Copilot-backend user:

--goal text is typed into the new session's PTY, and macOS canonical-mode input caps a line at ~1KB. My multi-KB goals were silently mangled — zmx history showed the paste sitting at an unsubmitted shell prompt with words dropped mid-string (CONFLICT SCOPECONFLICT , / in one debate roundin one debate). The node reported state=running while presence was idle/heuristic and no copilot child process ever existed. The loop created alone survived only because it was created alone.

Workaround: wrote each full brief to a file and made the goal a short pointer to it.

Root cause

ZmxSessionLauncher.arguments(forNode:) guards the assembled command with fitsInATypedCommandLine (800-byte budget under MAX_CANON's 1024), but the overflow fallback only drops the briefing and returns the unbriefed command unconditionally. When the prompt itself is multi-KB, the unbriefed command still overruns: the tty eats the tail mid-quote, the shell parks at a continuation prompt, no backend process ever starts — while the graph shows the node running.

The codebase already learned this lesson twice (SessionBriefing, NodeMemory wake digest): long prose is delivered by file path, never typed. The prompt is the one remaining payload that still rides the typed line.

Fix

When the command overruns even after dropping the briefing, write the full prompt to a per-node file (support directory, same lifecycle as node memory) and type only a short ASCII pointer to it. Grant the file's directory to path-verifying backends (Copilot --add-dir), and deliver the file to the remote host for remote loops (same channel as the briefing/wake digest).

Activity

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

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions