Skip to content

Add explicit hosted OpenCode command - #47

Closed
sanchitmonga22 wants to merge 1 commit into
frontier/auth-device-flowfrom
frontier/opencode-cloud
Closed

Add explicit hosted OpenCode command#47
sanchitmonga22 wants to merge 1 commit into
frontier/auth-device-flowfrom
frontier/opencode-cloud

Conversation

@sanchitmonga22

Copy link
Copy Markdown
Collaborator

Summary

Adds the explicit hosted OpenCode command on top of the Cloud auth branch.

What changed

  • Adds rcli opencode --cloud --model <console-model-id> with -- argument passthrough.
  • Executes the installed OpenCode binary directly and injects an ephemeral OPENCODE_CONFIG_CONTENT.
  • Restores the caller environment after exit and avoids persistent OpenCode/tool-config mutations.
  • Refreshes the session when needed and never prints credentials.

Branch/base

This PR is intentionally stacked on frontier/auth-device-flow and should merge after the auth PR. It is not a replacement for the auth implementation.

API/contract notes

The command consumes the public model identifier and bearer-backed Cloud session established by the auth branch. It does not add automatic model routing or billing behavior.

Validation

  • Official kit build passed.
  • CTest: 7/7 passed.
  • Focused OpenCode tests: 3/3 passed.
  • Installed OpenCode 1.1.53 help probe passed.
  • Fake loopback Cloud session returned runanywhere/frontier/test-model; no fake token persisted.

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0190ff35-ecf4-4362-931b-bdde15f352ba

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@sanchitmonga22

Copy link
Copy Markdown
Collaborator Author

Superseded by stacked follow-up PR #50, which preserves Siddhesh's #34 harness/editor work and carries the hosted OpenCode change together with hardened account transport. Closing the duplicate branch so there is one review path.

@Siddhesh2377

Copy link
Copy Markdown
Collaborator

Overlap worth checking: PR #34 also adds an opencode command, and both touch src/app.cpp, src/commands/commands.h and the CMake wiring.

One implementation detail from #34 that may be relevant here: the provider config is passed to the spawned process through the OPENCODE_CONFIG_CONTENT environment variable and restored afterwards, rather than written to a file. Writing to the user's project or to ~/.config/opencode outlives the session and changes how opencode behaves when they run it themselves, which is a surprising thing for a CLI to do.

Not asking for a change — just flagging it so whoever merges second knows what they are reconciling against.

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