Skip to content

bug(ask-user): full-size answer drafts block editor control keys #577

Description

@ooiuuii

Problem

A currently open ask_user free-form draft at the legal 8,000-byte limit cannot be submitted with Enter or shortened with Backspace. The outer input-range preflight treats control-key bytes as additional inserted text and rejects them when the remaining draft budget is zero.

Reproduction

On main f6b49ae59605b1276b8267f2886d22c03f01533c, use the registered ask_user tool and native Pi Editor:

  1. Enter a free-form answer and fill exactly 8,000 UTF-8 bytes.
  2. Press Enter: the review screen does not open.
  3. Or press Backspace: a size-limit error appears rather than deleting text.

The existing command-aware prospectiveAnswerDraftFits logic would allow these controls, but the earlier range gate rejects them first.

Expected / scope

Bound input allocation, then let the existing editor-aware check distinguish commands from inserted text. Keep the same byte cap and review-before-submit semantics; oversized insertions and large paste buffers must remain rejected.

Actual registered-tool/native-editor regressions fail 2/2 before the fix and pass afterward; the full affected input/sanitization group passes 30/30.

This is separate from #499's claimed overlay reopen/draft-lifecycle and unanswered-review work. It does not implement those features, change the questionnaire schema, or close that issue.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions