Skip to content

bug(cli): managed deployment errors don't name the bad field or the missing bundle path #5176

Closed

Description

@tale-code-bot

Part of #4839 (split from it in task TALE-176).

Problem

#4839 addendum 4, defect 8, and addendum 5, defect 12. Paths are under tools/cli/src/.

# Defect Code What the operator sees
8 A schema error names no field operationalFailure turns every z.ZodError into the caller's fixed sentence: commands/operational-failure.ts:36 if (error instanceof z.ZodError) return preconditionError(fallback.schema);. The managed deployment commands pass "Deployment input does not match its schema." (commands/deploy/managed.ts:29-33). The zod error isn't attached as a cause (utils/fail.ts:50). Specs are parsed at lib/deployment/prepare.ts:34-36 and lib/deployment/model.ts:535-536, bundle manifests at lib/deployment/bundle.ts:128 A typo in a deployment spec or a bundle manifest gives that one sentence and exit code 3, with no path, field or expected type. The operator has to diff the file against the docs by hand
12 A mistyped bundle directory or a missing deployment.json isn't named lib/deployment/bundle.ts:120 const rootInfo = await lstat(root); and :123 const info = await lstat(join(root, 'deployment.json')); (Node's lstat, :12) run before the explicit checks (:121-122, :124-126). For a path that doesn't exist, lstat throws Node's ENOENT, which isn't a CliError, ConfigError or ZodError. So operationalFailure replaces it with the caller's fixed summary: operational-failure.ts:37 return preconditionError(fallback.summary, fallback.next);. The call path is commands/deploy/index.ts:101, managed.ts:121, lib/deployment/apply.ts:577, bundle.ts:189 tale deploy --bundle ./bundel reports "Deployment failed. Review the source pins, paths, permissions and retained recovery receipts." (managed.ts:32), exit code 3. The explicit checks right after it, "Deployment bundle must be a regular directory." and "Deployment manifest is not a bounded regular file.", would have said what's wrong, but they never run

Notes, all at 29e9445:

Expected

Regression:

  • support pptx,docx and reduce envs #8: in commands/deploy/managed.test.ts (describePosix('managed deployment failures', :78), run a spec that misses a required field through managedResult('deploy prepare', …), as the failure() helper does (:65-67). The summary must name that field's path. At 29e9445 it is only "Deployment input does not match its schema.". commands/operational-failure.test.ts:55 pins today's sentence (:59 summary: fallback.schema,) and has to change.
  • feat: add file attachment support for chat agent with document parsing #12: verifyDeploymentBundle on a missing directory, and on a bundle without deployment.json, must refuse with a precondition error that names the path. Extend the bundle refusals in lib/deployment/inputs.test.ts:341-342, or the verify-bundle CLI test at tests/deployment.test.ts:265, which expects exit code 3 for a corrupt bundle (:316-323). At 29e9445 both cases throw Node's ENOENT, and the command shows the fixed summary.
  • commands/deploy/managed.test.ts:109 ("an unexpected failure keeps the fixed line, never its message") must keep passing.

Severity and owner

Activity

  1. added
    bug
    agent-ready
    on Oct 30, 2026
  2. added a commit that references this issue on Nov 1, 2026
    9fe571d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readybug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions