Skip to content

feat(compile-cli): load endpoint from ovcli.conf - #4642

Closed
qin-ctx wants to merge 5 commits into
mainfrom
feat/compile-cli-custom-url
Closed

qin-ctx wants to merge 5 commits into
mainfrom
feat/compile-cli-custom-url

Conversation

@qin-ctx

@qin-ctx qin-ctx commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Description

The restricted Compile CLI currently hardcodes the production OpenViking endpoint, so a Managed Agent created for STG or another deployment reads and writes the wrong collection even when its Vault API key belongs to that deployment.

After this change, @openviking/compile reads only url from the standard ovcli.conf; when no config file exists it keeps the current production endpoint as the default. Authentication remains isolated: the CLI ignores credentials from the file and continues to use only the Vault-provided OPENVIKING_API_KEY.

Example: with the same ov read viking://resources/source/file.md command, {"url":"https://stg.example.com/openviking"} routes the request to STG, while no config file routes it to https://api.vikingdb.cn-beijing.volces.com/openviking.

This PR also brings the already published restricted CLI source onto current main and supplies empty values for newer optional handler arguments, without exposing additional commands or options.

Human Involvement

  • A human participated in the implementation or review loop
  • This PR was generated entirely by AI agents without human participation in the loop

Related Issue

Supports the external Compile integration in PR #4436.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test update

Changes Made

  • Load the Compile data-plane URL from ovcli.conf, with the existing production URL as the fallback.
  • Keep API key ownership in OPENVIKING_API_KEY and ignore authentication fields from the config file.
  • Align the restricted wrapper with current handler signatures while preserving its existing command surface.

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this on the following platforms:
    • Linux
    • macOS
    • Windows

Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Screenshots (if applicable)

Not applicable.

Additional Notes

The Base Server counterpart writes an URL-only ovcli.conf during Managed Agent Environment setup and keeps the API key in the Vault credential.

@qin-ctx qin-ctx closed this Sep 3, 2026
@github-project-automation github-project-automation Bot moved this from Backlog to Done in OpenViking project Sep 3, 2026
@qin-ctx
qin-ctx deleted the feat/compile-cli-custom-url branch September 3, 2026 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants