feat: show runtime settings in status#106
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe ChangesRuntime Status Reporting
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/cli/opencode-cursor.ts`:
- Line 180: The `logging.console` property uses a simple `=== "1"` comparison
for the `CURSOR_ACP_LOG_CONSOLE` environment variable, while `agentPool.enabled`
and `sessionResume.enabled` use helper functions that accept multiple truthy
values like "1", "true", "on", and "yes". Replace the `=== "1"` check for
`logging.console` with the same helper function pattern used by the other
boolean environment variable checks to ensure consistent parsing across all
environment-based boolean configurations.
- Line 181: The default logging directory in the status output on the dir
property uses a literal tilde notation (~/.opencode-cursor) which does not match
the actual path expansion used by the logger implementation in
src/utils/logger.ts. Replace the tilde notation in the dir property with
path.join(os.homedir(), ".opencode-cursor") to accurately reflect the absolute
path that users will actually see in their logs. Make sure os and path modules
are imported at the top of the file if they are not already present.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 428f7951-b098-41ae-a292-520e1d49fb22
📒 Files selected for processing (2)
src/cli/opencode-cursor.tstests/unit/cli/opencode-cursor.test.ts
| }, | ||
| logging: { | ||
| level: process.env.CURSOR_ACP_LOG_LEVEL || "info", | ||
| console: process.env.CURSOR_ACP_LOG_CONSOLE === "1", |
There was a problem hiding this comment.
Inconsistent boolean parsing for logging.console.
The logging.console field uses a simple === "1" check, while agentPool.enabled and sessionResume.enabled use helpers that accept multiple truthy values ("1", "true", "on", "yes"). This means CURSOR_ACP_LOG_CONSOLE=true won't enable console logging, creating an inconsistent user experience.
🔧 Proposed fix to use consistent boolean parsing
Consider creating a shared helper or checking multiple truthy values:
- console: process.env.CURSOR_ACP_LOG_CONSOLE === "1",
+ console: ["1", "true", "on", "yes"].includes(process.env.CURSOR_ACP_LOG_CONSOLE?.toLowerCase() || ""),Alternatively, extract a shared helper like isBooleanEnvEnabled(key) and use it consistently across all boolean environment variables.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| console: process.env.CURSOR_ACP_LOG_CONSOLE === "1", | |
| console: ["1", "true", "on", "yes"].includes(process.env.CURSOR_ACP_LOG_CONSOLE?.toLowerCase() || ""), |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/cli/opencode-cursor.ts` at line 180, The `logging.console` property uses
a simple `=== "1"` comparison for the `CURSOR_ACP_LOG_CONSOLE` environment
variable, while `agentPool.enabled` and `sessionResume.enabled` use helper
functions that accept multiple truthy values like "1", "true", "on", and "yes".
Replace the `=== "1"` check for `logging.console` with the same helper function
pattern used by the other boolean environment variable checks to ensure
consistent parsing across all environment-based boolean configurations.
3a90c10 to
bf63392
Compare
PR A for the perf work.\n\nAdds a runtime block to open-cursor status / status --json so we can see the backend preference, agent pool, session resume, and logging settings before benchmarking.\n\nVerification:\n- bun test tests/unit/cli/opencode-cursor.test.ts\n- npm run build\n- npm test