Skip to content

fix#78

Closed
areporeporepo wants to merge 2 commits into
nasa-jpl:mainfrom
areporeporepo:fix/astream-token-spacing-and-rich-print
Closed

fix#78
areporeporepo wants to merge 2 commits into
nasa-jpl:mainfrom
areporeporepo:fix/astream-token-spacing-and-rich-print

Conversation

@areporeporepo
Copy link
Copy Markdown

@areporeporepo areporeporepo commented Apr 5, 2026

in favor of #76

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 5, 2026 17:33
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes two user-facing formatting issues in ROSA by correcting streamed token accumulation in astream() and ensuring _print_usage() outputs Rich-formatted markup correctly.

Changes:

  • Remove the extra space that was prepended to each streamed token when building final_output in astream().
  • Switch _print_usage() from print() to rich.console.Console().print() so Rich markup is rendered.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/rosa/rosa.py Outdated
Comment on lines 18 to 22

from rich.console import Console
from contextlib import contextmanager
from typing import TYPE_CHECKING, Any, AsyncIterable, Dict, Literal, Optional, Union

Copy link

Copilot AI Apr 5, 2026

Choose a reason for hiding this comment

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

Import grouping looks off: from rich.console import Console (third-party) is currently placed between stdlib imports (logging and contextlib). Consider grouping stdlib imports together, then third-party (rich/langchain), then local imports to keep a consistent import order.

Suggested change
from rich.console import Console
from contextlib import contextmanager
from typing import TYPE_CHECKING, Any, AsyncIterable, Dict, Literal, Optional, Union
from contextlib import contextmanager
from typing import TYPE_CHECKING, Any, AsyncIterable, Dict, Literal, Optional, Union
from rich.console import Console

Copilot uses AI. Check for mistakes.
@areporeporepo areporeporepo force-pushed the fix/astream-token-spacing-and-rich-print branch from bb7479d to ffae7e0 Compare April 5, 2026 17:59
@areporeporepo areporeporepo deleted the fix/astream-token-spacing-and-rich-print branch April 5, 2026 18:16
@areporeporepo areporeporepo changed the title fix: correct astream token spacing and use rich Console for usage output fix Apr 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants