Repository navigation
fix(cli): print data keys as they are and label refusal details as details - #911
Open
Brooooooklyn wants to merge 1 commit into
Open
Brooooooklyn wants to merge 1 commit into
Brooooooklyn wants to merge 1 commit into
Conversation
…tails
Operator text output turned every object key into a label, so data keys
such as worker names ("email-gateway") and model IDs
("@cf/zai-org/glm-5.3") had their hyphens replaced with spaces. Keys that
are not camelCase or snake_case field names now print unchanged.
A failed platform request with details always printed "Partial result:",
even for a plain refusal such as the self-hosted capability error. The CLI
now prints "Partial result:" only for partial failures and "Details:" for
everything else.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
🚀 Deploying Preview to Cloudflare 🚀Preview URL: https://fix-operator-output-keys-void-cloud.voidzero-docs.workers.dev (commit c5a231f)This URL reflects your latest Preview deploymentPreview Deployments by commit
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
How this was found
During a live end-to-end run of a self-hosted platform, done to test the security audits work (PR #886), two operator CLI text outputs looked wrong. Neither bug is part of that feature, and both exist on
maintoday, so this PR fixes them on their own.Bug 1: hyphens in data keys turn into spaces
Repro on
mainOn any platform, preview a full worker rollback in text mode:
The preview's
versionsobject is keyed by worker name (proxy,email-gateway,api, ...).email-gateway: <version id>Email gateway: <version id>With the security audits branch,
void platform security models --block @cf/zai-org/glm-5.3 --planprinted@cf/zai org/glm 5.3: 1, which is a model ID nobody can copy back into a command.Root cause
fieldLabelinpackages/void/src/cli/operator-cmd.ts:113(onmain) turns every object key into a readable label: it splits on spaces,_and-, lowercases, and capitalizes the first word. That is right for field names likecreatedAtorproject_id, but wrong for keys that are data.Fix
API field names are camelCase or snake_case. A small character check (
isFieldName, no regex) now treats any key with another character (-,/,@,.,:, space) as data and prints it unchanged. Field names are still labelled as before (createdAt->Created at,project_id->Project ID).Bug 2: plain refusals print "Partial result:"
Repro on
mainOn a self-hosted platform, run any hosted-only worker command in text mode:
The API replies
501 capability_unavailablewithdetails: { capability: "hosted-platform-operations" }(platform/packages/api/src/operator/worker-operations.ts:20).Details:and the details."Partial result" tells the operator that some work was done, but nothing ran. Other refusals with details hit the same path, for example
revision_conflict,plan_has_accountsandownership_transfer_blocked.Root cause
packages/void/src/cli/cli-main.ts:103(onmain) printsPartial result:for everyOperatorClientErrorthat hasdetails, whatever the error code.Fix
isPartialResultprintsPartial result:only when the error code ispartial_failureor the details saypartial: true. Any other error printsDetails:. The details are still printed in full, and--jsonoutput does not change.Tests
packages/void/test/unit/operator-cli.test.ts:humanLineskeeps@cf/zai-org/glm-5.3,email-gatewayandapi.example.comunchanged and still labelscreatedAtandproject_id.packages/void/test/integration/operator-cli.test.ts(real CLI subprocess against a stub HTTP server):worker rollback-all --planprintsemail-gateway: version-gateway.501 capability_unavailablerefusal printsDetails:and notPartial result.Partial result:.vp run --filter ./packages/void typecheck,vp lintandvp fmt --checkpass on the changed files.vp run test: everything this PR touches passed. Some platform API integration tests timed out because the machine was heavily loaded (load average above 100). None of them use the changed code exceptoperator-cli-e2e, which passed on rerun. The rest passed on rerun or with a longer timeout.vp checkreported only "Invalid tsconfig" errors for playgrounds whose.void/tsconfig.jsonhad not been generated yet.🤖 Generated with Claude Code