Skip to content

Fix engine-side KCL websocket authentication - #1816

Open
Joe-Spencer wants to merge 1 commit into
mainfrom
codex/engine-execution-websocket-auth
Open

Fix engine-side KCL websocket authentication#1816
Joe-Spencer wants to merge 1 commit into
mainfrom
codex/engine-execution-websocket-auth

Conversation

@Joe-Spencer

Copy link
Copy Markdown

Summary

  • forward the token already resolved by Zoo CLI as an in-band WebSocket Headers request before ExecKclProject
  • tolerate only a bounded set of uncorrelated auth_token_missing responses that can race the authentication frame
  • send ExecKclProject as named MessagePack binary while keeping authentication and ordinary modeling commands as JSON text

Why

ENGINE_EXECUTION=1 authenticated the WebSocket upgrade with the normal CLI credential, but OAuth tokens created by zoo auth login also need the protocol-level Authorization header frame. Without it, engine-side KCL execution could fail even though zoo auth status succeeded.

Validation

  • cargo fmt --all -- --check
  • cargo clippy --all-features --all-targets -- -D warnings
  • cargo test --locked context::test:: -- --nocapture (7 passed)
  • cargo test --locked snapshot_via_engine -- --ignored --nocapture
  • live unchanged five-file Axial Fan export with ENGINE_EXECUTION=1, all token environment variables removed, and authentication supplied only by the normal CLI credential store: succeeded in 6.03 s and produced an 889,607-byte STEP

@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.61017% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.55%. Comparing base (540418d) to head (27bbff7).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
src/context.rs 96.61% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1816      +/-   ##
==========================================
+ Coverage   67.02%   67.55%   +0.52%     
==========================================
  Files          43       43              
  Lines        8403     8512     +109     
==========================================
+ Hits         5632     5750     +118     
+ Misses       2771     2762       -9     
Flag Coverage Δ
unittests 67.55% <96.61%> (+0.52%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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