Files
multica/server
Eve b19434ec60 fix(agent/grok): ACP authenticate handshake, migration 166, headless --no-auto-update
Harden the Grok Build ACP runtime (originally #5285 by @sanjay3290) to
address the three blockers found in triage review (MUL-4430):

- Auth handshake: after `initialize`, read `authMethods` and send
  `authenticate` (preferring xai.api_key when XAI_API_KEY is set, else
  cached_token) before session/new or session/load — matching xAI's
  documented headless ACP flow. Without it a real, logged-in CLI rejects
  every session op. Model discovery (discoverACPModels) gets the same
  optional handshake so it returns the real catalog instead of the static
  fallback. Ref: https://docs.x.ai/build/cli/headless-scripting
- Migration renumbered 163 -> 166: main advanced to 163/164/165, so 163
  collided and would trip the unique-prefix migrations lint.
- `--no-auto-update` is now passed by the daemon as a global flag (and kept
  in the blocked custom-arg set) so background update checks never stall an
  unattended ACP task, per xAI's automation guidance.

Tests: fake ACP now advertises authMethods + handles authenticate;
new tests assert authenticate is ordered initialize<authenticate<session
for both new and resume, that a rejected handshake fails the task, and
cover the auth-method selection preference. argv test updated for the
--no-auto-update prefix.

Co-authored-by: multica-agent <github@multica.ai>
2026-07-13 13:11:23 +08:00
..