issue-create truncates a multiline --body value at the first newline #658

Closed
opened 2026-09-23 21:43:05 +00:00 by jared · 2 comments
Owner

Problem

bin/os-backlog issue-create --body "" stores only the first line of the body. The command has no --body-file option, unlike comment, which has one. This forces callers to pass multiline text through a single --body string, and it does not survive.

Observed

An agent filed a ticket with a multiline --body value. Only the first line reached the tracker; the rest of the drafted body was lost.

plugins/os-backlog/bin/os-backlog issue-create --title "

## Problem bin/os-backlog issue-create --body "<multiline>" stores only the first line of the body. The command has no --body-file option, unlike comment, which has one. This forces callers to pass multiline text through a single --body string, and it does not survive. ## Observed An agent filed a ticket with a multiline --body value. Only the first line reached the tracker; the rest of the drafted body was lost. plugins/os-backlog/bin/os-backlog issue-create --title "<title>" --body "<multiline>" --label <scope> --label filed-by/agent Issue created with a body containing only the first line of the intended multiline text. Independent check this session: calling Backlog::CLI.start directly with a multiline --body value in ARGV (bypassing any shell) preserved the full string through Thor's own option parser — Thor's argument parsing is not, by itself, the point of loss. The loss most plausibly happens at the shell/tool layer that builds the command line for os-backlog (word-splitting or similar), not inside Backlog::CLI#issue_create. This narrows, but does not close, the root cause. ## Reproduce bin/os-backlog issue-create --title "test" --body "line one line two" --label plugin/os-backlog --label filed-by/agent Expect the stored body to contain both lines; it contains only "line one" in the reported failure. ## Approach Required work: 1. Add a --body-file option to issue-create, matching comment's existing --body-file — check: bin/os-backlog issue-create --help lists --body-file. 2. Record in the close note that the truncation point is outside this repository: an in-process run of Backlog::CLI.start with a three-line --body on 2026-09-27 stored all three lines, and the tea/gh backends pass the body as one argv element to Open3.capture3; no code change for item 2. Rejected: leaving --body-file absent and telling callers to always call Backlog::Issues directly — that workaround already exists ad hoc; it should not be the permanent interface. ## Acceptance criteria 1. Given a multiline value written to a file, when issue-create --body-file <path> is run, then the created issue's body is the full file contents. 2. Given both --body and --body-file, when issue-create runs, then it refuses and names the conflict, mirroring comment. 3. Given a multiline --body-file, when issue-create runs on a forgejo tracker, then the tea backend receives the full file contents as one --description argv element. ## Owner sketch class Backlog::CLI def issue_create body = options[:body_file] ? File.read(options[:body_file]) : options[:body] end end ## Origin • Trigger: an agent's os-backlog issue-create --body "<multiline>" call during normal capture work. • Improvised this session: a script that calls Backlog::Issues directly, bypassing the CLI, to post the full body. • Chain: truncated issue body ← --body multiline value lost after the first line ← IMPROVISATION: root cause not yet isolated to a specific line of Backlog::CLI#issue_create or the invoking shell layer; the direct-ARGV check in ## Observed rules out Thor's own parser as the sole cause. • Where: plugins/os-backlog/lib/backlog/cli.rb, issue_create (compare comment, which already has --body-file). • Session: a5f43be9-5476-418e-99f0-2c4d0e5fa57d • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/a5f43be9-5476-418e-99f0-2c4d0e5fa57d.jsonl Skeptic gate: not triggered. The user named this exact bug and explicitly asked for it to be captured this session, so it is a user-approved ticket, not an AI-initiated follow-up; per the capture skill, a user-named or user-approved ticket flows through untouched.
Author
Owner

Work started 2026-09-27 on branch ticket-658 via /os-sdlc:implement.

Work started 2026-09-27 on branch ticket-658 via /os-sdlc:implement.
Author
Owner

Resolution

Done: issue-create accepts --body-file, mirroring comment; both --body and --body-file together refuse with a named conflict; the body reaches the tea backend as one --description argv element.

Evidence: Implementation 49 on branch ticket-658, 11 dispatches all gates green; new test plugins/os-backlog/tests/issue_create_body_file_cli_test.rb; os-backlog suite green. Truncation point is outside this repository: an in-process Backlog::CLI.start with a three-line --body stored all three lines on 2026-09-27, and TeaBackend/GhBackend pass the body as one argv element to Open3.capture3, so no code change for Required work item 2.

Follow-ups: none

## Resolution **Done:** issue-create accepts --body-file, mirroring comment; both --body and --body-file together refuse with a named conflict; the body reaches the tea backend as one --description argv element. **Evidence:** Implementation 49 on branch ticket-658, 11 dispatches all gates green; new test plugins/os-backlog/tests/issue_create_body_file_cli_test.rb; os-backlog suite green. Truncation point is outside this repository: an in-process Backlog::CLI.start with a three-line --body stored all three lines on 2026-09-27, and TeaBackend/GhBackend pass the body as one argv element to Open3.capture3, so no code change for Required work item 2. **Follow-ups:** none
jared closed this issue 2026-09-27 14:27:15 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#658
No description provided.