Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib/arg-parsing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1244,7 +1244,7 @@ export function buildProjectQuery(
*/
export function splitNewlineArg(arg: string): string[] {
return arg
.split("\n")
.split(/\s+/)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The change to split arguments on any whitespace (/\s+/) in splitNewlineArg will incorrectly break up project display names containing spaces, like "org/My Project".
Severity: HIGH

Suggested Fix

The fix should be more targeted to only apply to the arguments that are expected to be lists (like event IDs), while preserving the original behavior for arguments that could be project display names. This might involve making the splitting behavior conditional or applying it at a different stage of parsing, after project arguments have already been identified and handled. For example, only apply the whitespace split within the event view command's argument handling, not globally in splitNewlineArg.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: src/lib/arg-parsing.ts#L1247

Potential issue: The function `splitNewlineArg` was changed to split arguments on any
whitespace (`/\s+/`) to support space-separated IDs. However, this introduces a
regression. The CLI supports project display names with spaces (e.g., `"org/My
Project"`), and has logic to handle them as a single argument. When such a display name
is passed as a single string, which is a common scenario for programmatic callers like
AI agents, the new logic will incorrectly split it into multiple arguments (e.g.,
`["org/My", "Project"]`). This breaks downstream parsing logic which expects a single
project argument, causing command failures.

Also affects:

  • src/commands/event/view.ts:179

Did we get this right? 👍 / 👎 to inform future reviews.

.map((s) => s.trim())
.filter((s) => s.length > 0);
}
Loading