Repository navigation
docs(custom-engine): cover headless adapter pitfalls and add a ZCode example - #401
Conversation
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dfc6c141ad
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Recommending the CLI's most autonomous permission mode in the adapter checklist and the ZCode example removed approval prompts without saying anything about isolation. The default environment.type: none executes the CLI directly on the host, so yolo-style modes hand shell and file tools host privileges. Spell out that the mode needs environment.type: docker / opensandbox or an explicit tool allowlist, and point at build/guarded plus a narrower --disallowed-tools list for runs on none. Reported in review of alibaba#401.
|
Thanks for adding the headless integration guidance and the isolation warnings. One issue remains in the ZCode YAML example in The reference adapter in #377 writes the SessionResult to that file and does not print it to stdout. However, Please add the following under output_file: ${output_file}I verified this behavior against the implementation and ran the focused stdout/output-file tests, which passed. I have not run a live ZCode integration. The current CI and CLA checks are passing. I recommend fixing this configuration issue before merging. |
zpzjzj
left a comment
There was a problem hiding this comment.
The output-file configuration issue described in #401 (comment) is still present at this head. The ZCode example passes --output ${output_file}, but does not set engine.custom.local.output_file. The referenced adapter writes its SessionResult only to that file, while CustomAgent.readRawResult returns stdout when custom.Local.OutputFile is empty. Consequently the copied example cannot read the successful result.
Please add output_file: ${output_file} under engine.custom.local, alongside cwd, before merging. The isolation warning is already addressed; this request is specifically for the remaining result-delivery mismatch. Verified against the latest example, the referenced adapter, and the result-reading implementation; no live ZCode integration was run in this review.
|
Added in I traced the path before editing rather than only pasting the line: I also folded the general rule into the integration checklist ("It returns a parseable
|
|
The output-file issue is fixed, but I missed one documentation issue in my follow-up review: the current wording generalizes findings from Windows desktop CLI 0.17.1 in #377. The ZCode v3.18.2 standalone configuration docs describe selecting a custom provider and model through a separate configuration file using Before merging, please scope the model-selection limitation to the version and build actually tested, rather than stating that per-case model selection universally requires new CLI support. The documentation-based integration remains appropriate; there is no need to add a built-in engine for this. I have left my GitHub approval unchanged. |
…example Local adapters can deadlock on an open child stdin and on interactive approval prompts, and both failures surface as an empty timeout that looks like a slow agent. Document the two pitfalls in the integration checklist, and add a worked ZCode CLI configuration with its flag mapping so custom-engine authors have a starting point (alibaba#377).
Recommending the CLI's most autonomous permission mode in the adapter checklist and the ZCode example removed approval prompts without saying anything about isolation. The default environment.type: none executes the CLI directly on the host, so yolo-style modes hand shell and file tools host privileges. Spell out that the mode needs environment.type: docker / opensandbox or an explicit tool allowlist, and point at build/guarded plus a narrower --disallowed-tools list for runs on none. Reported in review of alibaba#401.
Head branch was pushed to by a user without write access
aa43b78 to
e3c8aa4
Compare
|
Thanks for scoping the ZCode limitations to the tested version in |
The example enabled the yolo mode without selecting an isolating runtime, so copying it ran ZCode on the host with its privileges. The example now carries the environment block that isolates it. The model-selection note also claimed that a model flag passes through `args`, but `local.args` only reaches the wrapper: the reference adapter does not forward arbitrary options to ZCode, so the wrapper has to parse and forward the option itself. Co-Authored-By: Claude Code <[email protected]>
|
Both changes are in (1) The example now selects an isolating runtime. The YAML snippet carries an (2) The model-selection note now says the wrapper has to forward the option itself. It no longer claims that a model flag passes through |
The stock node:22 image carries Node.js but no ZCode, and ${ZCODE_CLI} is
expanded on the host when the config loads, so a host install path never
reaches the container. Document the image that carries a ZCode build, point
ZCODE_CLI at the in-container path, and name the Windows fallback of the
reference adapter.
Co-Authored-By: Claude Code <[email protected]>
|
|
Summary
Document the two headless pitfalls that cost a custom-engine adopter the most time, and add a worked ZCode CLI configuration as a starting point.
docs/design/custom-engine.mdgains a ZCode CLI example: the flag mapping (-p,--json,--resume,--cwd,--mode,--disallowed-tools), theengine.customYAML, and the known limitation that headless ZCode resolves its model from the personal channel'sproviderOrderwith no per-run--modelflag, so${model}cannot be forwarded.writing-evalsguides point at the checklist from the Custom Engine section.Related issues
Refs #377. This follows the maintainer preference there for closing the gap with docs and a configuration example rather than a built-in engine.
Test plan
npm run docs:build→ build complete, no broken-link warnings.make verifyis unaffected.Notes
The example reuses the reference adapter attached to #377 (not vendored here); the adapter path is resolved inside the runtime workspace, so adopters ship it with the skill. The interactive-prompt and stdin advice applies to every custom engine, not just ZCode.
Disclosure
Prepared with DeepSeek Harness (deepseek-v4.1-flash) as the coding agent; the example and the claims above were checked against the issue report and the design document, not against a live ZCode install.