BUG-HUNT: [consistency] Spurious literal quote characters in agents plan current output due to malformed f-string #6426

Open
opened 2026-04-09 21:02:26 +00:00 by HAL9000 · 0 comments
Owner

Bug Report: [consistency] — Spurious Literal " Characters Appear in agents plan current Output

Severity Assessment

  • Impact: The agents plan current command displays cosmetic garbage (" characters) in the Rich panel output, making the CLI look broken to users. Specifically, a literal double-quote character appears after the prompt content and on the line showing the truncation ellipsis.
  • Likelihood: High — triggers on every invocation of agents plan current when there is a current plan.
  • Priority: Medium

Location

  • File: src/cleveragents/cli/commands/plan.py
  • Function/Class: current() command (the legacy @app.command() marked .. deprecated::)
  • Lines: 1228–1235

Description

The info_text f-string in the current() command has misplaced double-quote characters that are part of the string literal syntax but visually appear as garbage output. Inside the triple-quoted f-string, two lines end with a literal " followed by a newline, and the truncation indicator line is a separate string fragment that also ends with ".

Evidence

# src/cleveragents/cli/commands/plan.py lines 1228–1235
info_text = f"""
[bold]Current Plan:[/bold] {plan.name}
[bold]Status:[/bold] {plan.status}
[bold]Created:[/bold] {plan.created_at}
[bold]Prompt:[/bold] {plan.prompt[:200] if plan.prompt else "No prompt set"}"
"{" ... " if plan.prompt and len(plan.prompt) > 200 else ""}"
        """

Reproducing the problem in Python:

class FakePlan:
    name = 'test-plan'
    status = 'active'
    created_at = '2024-01-01'
    prompt = 'A short prompt'

plan = FakePlan()
info_text = f"""
[bold]Prompt:[/bold] {plan.prompt[:200] if plan.prompt else "No prompt set"}"
"{" ... " if plan.prompt and len(plan.prompt) > 200 else ""}"
"""
print(info_text)

Output:

[bold]Prompt:[/bold] A short prompt"
""

The trailing " after A short prompt is literally present in the rendered panel output, and an extra line containing "" appears below it.

For a long prompt (>200 chars):

[bold]Prompt:[/bold] <first 200 chars>"
" ... "

The intended code was almost certainly:

[bold]Prompt:[/bold] {plan.prompt[:200] if plan.prompt else "No prompt set"}
{"..." if plan.prompt and len(plan.prompt) > 200 else ""}

Expected Behavior

The panel should show:

Current Plan: test-plan
Status: active
Created: 2024-01-01
Prompt: A short prompt

(No trailing quote character, no extra blank "" line.)

Actual Behavior

The panel shows:

Current Plan: test-plan
Status: active
Created: 2024-01-01
Prompt: A short prompt"
""

Suggested Fix

Remove the extraneous " characters from the f-string template:

info_text = f"""
[bold]Current Plan:[/bold] {plan.name}
[bold]Status:[/bold] {plan.status}
[bold]Created:[/bold] {plan.created_at}
[bold]Prompt:[/bold] {plan.prompt[:200] if plan.prompt else "No prompt set"}{"..." if plan.prompt and len(plan.prompt) > 200 else ""}
"""

Category

consistency

TDD Note

After this bug issue is verified, a corresponding Type/Testing issue will be created for TDD. The test will use tags: @tdd_issue, @tdd_issue_, and @tdd_expected_fail to prove the bug exists before fixing it.


Automated by CleverAgents Bot
Supervisor: Bug Hunting | Agent: bug-hunter

## Bug Report: [consistency] — Spurious Literal `"` Characters Appear in `agents plan current` Output ### Severity Assessment - **Impact**: The `agents plan current` command displays cosmetic garbage (`"` characters) in the Rich panel output, making the CLI look broken to users. Specifically, a literal double-quote character appears after the prompt content and on the line showing the truncation ellipsis. - **Likelihood**: High — triggers on every invocation of `agents plan current` when there is a current plan. - **Priority**: Medium ### Location - **File**: `src/cleveragents/cli/commands/plan.py` - **Function/Class**: `current()` command (the legacy `@app.command()` marked `.. deprecated::`) - **Lines**: 1228–1235 ### Description The `info_text` f-string in the `current()` command has misplaced double-quote characters that are **part of the string literal syntax** but visually appear as garbage output. Inside the triple-quoted f-string, two lines end with a literal `"` followed by a newline, and the truncation indicator line is a separate string fragment that also ends with `"`. ### Evidence ```python # src/cleveragents/cli/commands/plan.py lines 1228–1235 info_text = f""" [bold]Current Plan:[/bold] {plan.name} [bold]Status:[/bold] {plan.status} [bold]Created:[/bold] {plan.created_at} [bold]Prompt:[/bold] {plan.prompt[:200] if plan.prompt else "No prompt set"}" "{" ... " if plan.prompt and len(plan.prompt) > 200 else ""}" """ ``` Reproducing the problem in Python: ```python class FakePlan: name = 'test-plan' status = 'active' created_at = '2024-01-01' prompt = 'A short prompt' plan = FakePlan() info_text = f""" [bold]Prompt:[/bold] {plan.prompt[:200] if plan.prompt else "No prompt set"}" "{" ... " if plan.prompt and len(plan.prompt) > 200 else ""}" """ print(info_text) ``` Output: ``` [bold]Prompt:[/bold] A short prompt" "" ``` The trailing `"` after `A short prompt` is literally present in the rendered panel output, and an extra line containing `""` appears below it. For a long prompt (>200 chars): ``` [bold]Prompt:[/bold] <first 200 chars>" " ... " ``` The intended code was almost certainly: ```python [bold]Prompt:[/bold] {plan.prompt[:200] if plan.prompt else "No prompt set"} {"..." if plan.prompt and len(plan.prompt) > 200 else ""} ``` ### Expected Behavior The panel should show: ``` Current Plan: test-plan Status: active Created: 2024-01-01 Prompt: A short prompt ``` (No trailing quote character, no extra blank `""` line.) ### Actual Behavior The panel shows: ``` Current Plan: test-plan Status: active Created: 2024-01-01 Prompt: A short prompt" "" ``` ### Suggested Fix Remove the extraneous `"` characters from the f-string template: ```python info_text = f""" [bold]Current Plan:[/bold] {plan.name} [bold]Status:[/bold] {plan.status} [bold]Created:[/bold] {plan.created_at} [bold]Prompt:[/bold] {plan.prompt[:200] if plan.prompt else "No prompt set"}{"..." if plan.prompt and len(plan.prompt) > 200 else ""} """ ``` ### Category consistency ### TDD Note After this bug issue is verified, a corresponding Type/Testing issue will be created for TDD. The test will use tags: @tdd_issue, @tdd_issue_<this-issue-number>, and @tdd_expected_fail to prove the bug exists before fixing it. --- **Automated by CleverAgents Bot** Supervisor: Bug Hunting | Agent: bug-hunter
HAL9000 added this to the v3.2.0 milestone 2026-04-09 21:09:48 +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
cleveragents/cleveragents-core#6426
No description provided.