Skip to content

feat(cli): show active profile in startup banner and /status#428

Merged
xinhuagu merged 1 commit into
mainfrom
feat/banner-profile-display
Apr 20, 2026
Merged

feat(cli): show active profile in startup banner and /status#428
xinhuagu merged 1 commit into
mainfrom
feat/banner-profile-display

Conversation

@xinhuagu

@xinhuagu xinhuagu commented Apr 20, 2026

Copy link
Copy Markdown
Owner

Summary

  • Surface AceClawConfig.activeProfileName() through health.status as a new profile field so the CLI can display which credential profile the session is using.
  • Add profile to TerminalRepl.SessionInfo, render it as an extra banner line between Model and Project, and add a Profile: entry to /status.
  • Line/entry is skipped when no profile is active — banner layout is unchanged for users who do not use profiles.

Motivation

Previously the startup banner only showed version, model, project, and session id. When a user has multiple profiles configured (e.g. a work claude-acn account and a personal claude account), there was no way to tell which one the daemon picked up without running a separate check. This PR makes the active profile visible at a glance.

Test plan

  • ./gradlew :aceclaw-daemon:test :aceclaw-cli:test — green
  • ./gradlew build (sans native-image) — green
  • Manual: start daemon with ACECLAW_PROFILE=<name> and confirm the banner shows Profile: <name> and /status lists it
  • Manual: start daemon with no profile configured and confirm the banner omits the Profile line (4-line layout preserved)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Profile information is now displayed in the terminal session banner and status output when available, providing greater visibility into the active configuration.

Surface AceClawConfig.activeProfileName() through health.status as a new
"profile" field, plumb it into TerminalRepl.SessionInfo, and render it as
an extra banner line (between Model and Project) plus an entry in
/status. The line is skipped when no profile is active, so the banner
layout is unchanged for users who do not use profiles.

Makes it obvious which credentials (e.g. work vs personal Anthropic
account) the current session is running against — previously only the
model name was visible.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@coderabbitai

coderabbitai Bot commented Apr 20, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Changes introduce profile data propagation from daemon configuration through the health status API to the CLI terminal session display, with daemon exposing active profile name and CLI retrieving and displaying it conditionally in banner and status output.

Changes

Cohort / File(s) Summary
Daemon profile tracking
aceclaw-daemon/src/main/java/dev/aceclaw/daemon/RequestRouter.java, aceclaw-daemon/src/main/java/dev/aceclaw/daemon/AceClawDaemon.java
Added volatile activeProfile field to RequestRouter with public setter; extended handleHealthStatus to include "profile" in JSON response when profile is non-null and non-blank; daemon initialization now sets active profile from configuration.
CLI profile retrieval and display
aceclaw-cli/src/main/java/dev/aceclaw/cli/AceClawMain.java, aceclaw-cli/src/main/java/dev/aceclaw/cli/TerminalRepl.java
Extended SessionInfo record with profile field and backward-compatible constructor overloads; AceClawMain retrieves profile from daemon health response and passes to session initialization; banner and /status output conditionally display profile when present.

Sequence Diagram(s)

sequenceDiagram
    participant DaemonConfig as Daemon<br/>Configuration
    participant Router as RequestRouter
    participant CLI as AceClawMain
    participant Terminal as TerminalRepl
    
    DaemonConfig->>Router: setActiveProfile(profileName)
    Note over Router: Stores profile in<br/>activeProfile field
    
    CLI->>Router: GET /health/status
    Router->>CLI: {model, provider, profile, ...}
    Note over CLI: Extracts profile<br/>from response
    
    CLI->>Terminal: new SessionInfo(..., profile)
    Note over Terminal: Stores profile in<br/>SessionInfo record
    
    Terminal->>Terminal: renderBanner()
    Note over Terminal: Display profile if<br/>non-null, non-blank
    
    Terminal->>Terminal: handleStatusCommand()
    Note over Terminal: Include Profile row in<br/>Session Status section
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested labels

breaking-change, needs-tests


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Require Test Coverage For New Logic ❓ Inconclusive Unable to verify the PR changes: the repository structure does not contain the modified files mentioned in the PR summary (AceClawMain.java, TerminalRepl.java, AceClawDaemon.java, RequestRouter.java) or their corresponding test files. Confirm the repository is checked out on the feat/banner-profile-display branch and verify whether the profile-related changes are present by searching for 'activeProfile' references in the codebase.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(cli): show active profile in startup banner and /status' is fully related to and accurately summarizes the main changes across the PR: displaying the active profile in the CLI banner and status endpoint.
Block Major Correctness And Security Risks ✅ Passed Changes expose existing configuration value through health/status and CLI UI without altering core logic, permission checks, or data flows.
No Api Breaking Changes Without Version Bump ✅ Passed Version was proactively bumped to 0.3.18-SNAPSHOT before this PR, indicating planned 0.3.18 release cycle. Public API changes are backward compatible through overloaded constructors.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/banner-profile-display

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ast-grep (0.42.1)
aceclaw-cli/src/main/java/dev/aceclaw/cli/TerminalRepl.java

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
aceclaw-cli/src/main/java/dev/aceclaw/cli/AceClawMain.java (1)

463-480: ⚠️ Potential issue | 🟡 Minor

Show the profile in aceclaw daemon status as well.

health.status now exposes profile, but this command still drops it, so the daemon status view remains inconsistent with the banner/REPL status.

Proposed fix
                 System.out.println("  Version:         " + result.path("version").asText("unknown"));
                 System.out.println("  Model:           " + result.path("model").asText("unknown"));
+                String profile = result.path("profile").asText("");
+                if (!profile.isBlank()) {
+                    System.out.println("  Profile:         " + profile);
+                }
                 System.out.println("  Active Sessions: " + result.path("activeSessions").asInt(0));
                 JsonNode mcp = result.path("mcp");
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@aceclaw-cli/src/main/java/dev/aceclaw/cli/AceClawMain.java` around lines 463
- 480, The daemon status output omits the new "profile" field from the
health.status response; update AceClawMain (where the health.status is printed)
to read result.path("profile").asText("unknown") and print it (e.g., add a
"Profile: " line alongside Status/Version/Model) so the aceclaw daemon status
output matches the banner/REPL profile; place the print near the Model line in
the same block that handles result to keep formatting consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@aceclaw-cli/src/main/java/dev/aceclaw/cli/AceClawMain.java`:
- Around line 463-480: The daemon status output omits the new "profile" field
from the health.status response; update AceClawMain (where the health.status is
printed) to read result.path("profile").asText("unknown") and print it (e.g.,
add a "Profile: " line alongside Status/Version/Model) so the aceclaw daemon
status output matches the banner/REPL profile; place the print near the Model
line in the same block that handles result to keep formatting consistent.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2b89ae3c-14cd-4d90-9ed7-d1555d648f14

📥 Commits

Reviewing files that changed from the base of the PR and between 82fffcd and 8a3d878.

📒 Files selected for processing (4)
  • aceclaw-cli/src/main/java/dev/aceclaw/cli/AceClawMain.java
  • aceclaw-cli/src/main/java/dev/aceclaw/cli/TerminalRepl.java
  • aceclaw-daemon/src/main/java/dev/aceclaw/daemon/AceClawDaemon.java
  • aceclaw-daemon/src/main/java/dev/aceclaw/daemon/RequestRouter.java

@xinhuagu xinhuagu merged commit 2e8a6d5 into main Apr 20, 2026
10 checks passed
@xinhuagu xinhuagu deleted the feat/banner-profile-display branch April 20, 2026 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant