Skip to content

Conversation

@jaydaftari
Copy link
Contributor

@jaydaftari jaydaftari commented Nov 14, 2025

Resolution for fast follow up for not interactive environments , Refer: #608

Summary by CodeRabbit

  • Bug Fixes

    • CLI startup now shows the loading spinner only in interactive terminal sessions; in non-interactive environments startup proceeds without the spinner, reducing unneeded output and startup overhead.
  • Documentation

    • Docstring updated to describe the conditional spinner behavior across interactive and non-interactive environments.

@coderabbitai
Copy link

coderabbitai bot commented Nov 14, 2025

Walkthrough

The CLI bootstrap was adjusted to show the spinner only when the process is attached to a terminal. In terminal environments the spinner wraps the import of main_run; in non-interactive environments the import occurs directly without displaying the spinner. The docstring was updated accordingly.

Changes

Cohort / File(s) Summary
Bootstrap conditional spinner logic
src/mcp_agent/cli/main_bootstrap.py
Replace unconditional spinner with terminal-aware conditional. When console is a terminal, create/start spinner while importing mcp_agent.cli.main.run; when not a terminal, import directly without spinner. Docstring updated to state spinner is terminal-only.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Bootstrap as main_bootstrap.run()
    participant Console
    participant Spinner
    participant MainRun as mcp_agent.cli.main.run

    User->>Bootstrap: invoke run()
    Bootstrap->>Console: isatty / terminal check

    alt terminal
        Console-->>Bootstrap: true
        Bootstrap->>Spinner: create & start (visual)
        Spinner-->>Bootstrap: running
        Bootstrap->>MainRun: import mcp_agent.cli.main.run (while spinner)
        MainRun-->>Bootstrap: import complete
        Spinner->>Spinner: stop & cleanup
    else non-terminal
        Console-->>Bootstrap: false
        Bootstrap->>MainRun: import mcp_agent.cli.main.run (no spinner)
        MainRun-->>Bootstrap: import complete
    end

    Bootstrap->>MainRun: call run()
    MainRun-->>User: main logic executes
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Single-file change with a localized conditional around import and spinner lifecycle.
  • Check spinner creation/cleanup and terminal detection edge cases.

Files/areas to pay attention to:

  • src/mcp_agent/cli/main_bootstrap.py — verify spinner is only used when terminal, imports remain correct, and no import-time side effects are altered.

Possibly related PRs

Poem

🐰
A tiny spinner waits for eyes to see,
Quiet when pipes and logs run free,
When terminals glow it twirls with cheer,
Importing swiftly, the path made clear,
Hop, run, and ship — the rabbit's near! 🥕

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Feature/indicator' is vague and generic, using non-descriptive terms that do not convey meaningful information about the actual changeset. Use a more descriptive title that reflects the main change, such as 'Make spinner conditional on terminal availability' or 'Skip spinner in non-interactive environments'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a6b3ebf and cb1c22b.

📒 Files selected for processing (1)
  • src/mcp_agent/cli/main_bootstrap.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/mcp_agent/cli/main_bootstrap.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/mcp_agent/cli/main_bootstrap.py (1)

13-13: Fix grammar and punctuation in docstring.

The docstring has a grammatical issue and an extra space before the comma.

Apply this diff to improve the docstring:

-    """Display a spinner during only terminal bootstrap , then hand off to main.run()."""
+    """Display a spinner only during terminal bootstrap, then hand off to main.run()."""
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ccaab49 and a6b3ebf.

📒 Files selected for processing (1)
  • src/mcp_agent/cli/main_bootstrap.py (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: checks / test
🔇 Additional comments (1)
src/mcp_agent/cli/main_bootstrap.py (1)

15-21: LGTM! Clean conditional logic for terminal detection.

The terminal detection using console.is_terminal is the correct approach for conditionally displaying the spinner. The implementation properly addresses the PR objective by ensuring quiet behavior in non-interactive environments while maintaining user feedback in terminals.

@rholinshead
Copy link
Member

Awesome, thanks @jaydaftari

@rholinshead rholinshead merged commit ba4cb2f into lastmile-ai:main Nov 18, 2025
7 checks passed
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