feat(cli): show active profile in startup banner and /status#428
Conversation
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>
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
📝 WalkthroughWalkthroughChanges 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
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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.javaThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
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 | 🟡 MinorShow the profile in
aceclaw daemon statusas well.
health.statusnow exposesprofile, 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
📒 Files selected for processing (4)
aceclaw-cli/src/main/java/dev/aceclaw/cli/AceClawMain.javaaceclaw-cli/src/main/java/dev/aceclaw/cli/TerminalRepl.javaaceclaw-daemon/src/main/java/dev/aceclaw/daemon/AceClawDaemon.javaaceclaw-daemon/src/main/java/dev/aceclaw/daemon/RequestRouter.java
Summary
AceClawConfig.activeProfileName()throughhealth.statusas a newprofilefield so the CLI can display which credential profile the session is using.profiletoTerminalRepl.SessionInfo, render it as an extra banner line betweenModelandProject, and add aProfile:entry to/status.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-acnaccount and a personalclaudeaccount), 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) — greenACECLAW_PROFILE=<name>and confirm the banner showsProfile: <name>and/statuslists it🤖 Generated with Claude Code
Summary by CodeRabbit