feat(DIS-106): RunResult discriminated union replaces Promise<string> #51
No reviewers
Labels
No labels
blocked
needs-review
phase:0
phase:1
phase:1.5
phase:2
phase:3
phase:4
phase:5
phase:6+
priority:p0
priority:p1
priority:p2
security
type:chore
type:ci
type:docs
type:feat
type:fix
type:idea
type:known-issue
type:refactor
type:test
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: dev/disclaw#51
Loading…
Reference in a new issue
No description provided.
Delete branch "phase-1/runner-api-runresult"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
RunResultdiscriminated union type (success | timeout | cli-error | parse-error) insrc/agent/types.tsrunner.tsto resolve instead of reject for all error cases, returning typedRunResultobjectsrouter.tsto switch over all four status variants with user-facing error messagestests/unit/runner-result.test.tscovering all four status paths with a mocked cross-spawnTest plan
(a) success� valid JSON stdout ?status: "success"with correct text(b) timeout� process hangs past timeout ?status: "timeout"withtimeoutMs(c) cli-error� non-zero exit code ?status: "cli-error"with error message(d) cli-error ENOENT� spawn ENOENT error ?status: "cli-error"with "not found" message--noEmit(zero errors)?? Generated with Claude Code
e2ef9c7c67toe396e6d163669ecb2b5dtoa1a0c80acc