Skip to content

feat: show runtime settings in status#106

Merged
Nomadcxx merged 1 commit into
mainfrom
feat/status-runtime-visibility
Jun 18, 2026
Merged

feat: show runtime settings in status#106
Nomadcxx merged 1 commit into
mainfrom
feat/status-runtime-visibility

Conversation

@Nomadcxx

Copy link
Copy Markdown
Owner

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

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1bd1015b-df5b-490d-ac30-a93f3cc79399

📥 Commits

Reviewing files that changed from the base of the PR and between 3a90c10 and bf63392.

📒 Files selected for processing (2)
  • src/cli/opencode-cursor.ts
  • tests/unit/cli/opencode-cursor.test.ts

📝 Walkthrough

Walkthrough

The opencode-cursor CLI gains a runtime section in its StatusResult type, populated by a new getRuntimeStatus() helper that reads CURSOR_ACP_* environment variables for backend preference, agent pool enabled/idle-ms, session resume, and logging config. This data is included in getStatusResult() output and printed in the status command. Unit tests validate the full runtime structure and fallback behavior.

Changes

Runtime Status Reporting

Layer / File(s) Summary
StatusResult runtime type, getRuntimeStatus() helper, and wiring
src/cli/opencode-cursor.ts
Adds imports for isAgentPoolEnabled and parseAgentPoolIdleMs; extends StatusResult with a nested runtime object covering backend.preference, agentPool.enabled/idleMs, sessionResume.enabled, and logging fields; implements getRuntimeStatus() to derive those values from env vars and helper parsers; includes runtime: getRuntimeStatus() in the getStatusResult() return.
CLI output section and unit tests
src/cli/opencode-cursor.ts, tests/unit/cli/opencode-cursor.test.ts
Extends the status command printer with a "Runtime" block displaying all new runtime fields; adds two tests verifying that result.runtime matches expected structure when CURSOR_ACP_* env vars are set, and that logging.dir falls back to the user home .opencode-cursor directory when unset.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding a runtime settings section to the status command output.
Description check ✅ Passed The description is directly related to the changeset, explaining the purpose of adding runtime settings to the status command and listing verification steps.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ 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.

❤️ 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.

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

📥 Commits

Reviewing files that changed from the base of the PR and between fce9e62 and 3a90c10.

📒 Files selected for processing (2)
  • src/cli/opencode-cursor.ts
  • tests/unit/cli/opencode-cursor.test.ts

},
logging: {
level: process.env.CURSOR_ACP_LOG_LEVEL || "info",
console: process.env.CURSOR_ACP_LOG_CONSOLE === "1",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

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.

Suggested change
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.

Comment thread src/cli/opencode-cursor.ts Outdated
@Nomadcxx Nomadcxx force-pushed the feat/status-runtime-visibility branch from 3a90c10 to bf63392 Compare June 18, 2026 09:28
@Nomadcxx Nomadcxx merged commit 7611f87 into main Jun 18, 2026
2 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.

1 participant