Skip to content

programmatic addTodo callers need resilience, not just a human-oriented hard-fail at maxNotesBytes #16

Description

@rz1989s

Context

maxNotesBytes (default 8192) is intentional bloat-prevention — notes auto-inject into every pi prompt as the ## Open TODOs (N) block, so unbounded notes = unbounded context cost (see #1). The cap + the hard-reject at src/caps.ts:34 / src/todo-store.ts:205,276 are correct for human-written notes.

The gap is for programmatic callers. The hard-fail + the message "notes 8.2KB > max 8.0KB (maxNotesBytes 8192) — trim the detail or split into multiple todos" is human-oriented: a programmatic caller (e.g. @getpipher/armory-fleet subagent tool, src/todo-sync/adapter.ts:57) can neither "trim the detail" on the fly nor "split into multiple todos" for a single dispatch. It just fails — and in the armory-fleet case, the failure cancels the whole subagent dispatch (see getpipher/armory-fleet#34).

Proposal (defensive DX, not a cap change)

Keep maxNotesBytes + the hard-reject for the human /todo + todo tool surface. For programmatic callers, add ONE of:

  1. An opt-in truncateNotes flag on addTodo/updateTodo — when set, notes are truncated to maxNotesBytes (with a …[truncated] marker) instead of rejected. The caller explicitly accepts truncation. Default unchanged (hard-reject).
  2. A notesSummary field distinct from notes — programmatic callers write a short summary (always under cap) into notes; the full body lives elsewhere (run-log, report file). This matches how armory-fleet SHOULD use it (tracking stub, not transcript).
  3. A programmatic-callers README section documenting the cap + the recommended pattern (keep notes < ~1 KB; store the full body out-of-band). Cheapest; no API change.

My lean: (1) is the smallest change that unblocks armory-fleet without a design conversation; (3) is a free win regardless. (2) is the cleanest model but a bigger API change.

Cross-ref

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions