fix(trail): review feedback — stderr auth errors, trim type/priority, partial-update clarity · Entire

fix(trail): review feedback — stderr auth errors, trim type/priority, partial-update clarity

d4732b1→main·

computermode·1w ago·6 files·+58 added/-27 removed

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com

Sessions

01KX6THZDP2XW3WDGFFAZ4WRXW View transcript

CLI Trail Commands and UI Parity

Claude Code·Opus 4.8·1 step

Changes

6

return ""
}

goc func submitTrailApproval(ctx context.Context, w io.Writer, insecureHTTP bool, repoOverride, selector, branch, event, message, successVerb string) error {
func submitTrailApproval(ctx context.Context, w, errW io.Writer, insecureHTTP bool, repoOverride, selector, branch, event, message, successVerb string) error {
if selector != "" && strings.TrimSpace(branch) != "" {
return errors.New("pass a trail selector or --branch, not both")
}
1 unmodified line

if err != nil {
return err
}
return runAuthenticatedTrailAPI(ctx, w, insecureHTTP, repoOverride, func(ctx context.Context, client *api.Client) error {
// Auth/not-logged-in messages go to stderr; w carries command output only.
return runAuthenticatedTrailAPI(ctx, errW, insecureHTTP, repoOverride, func(ctx context.Context, client *api.Client) error {
found, forge, owner, repoName, err := resolveNumberedTrail(ctx, client, repoOverride, selector, branch)
if err != nil {
return err
}
26 unmodified lines

// The trail must be open and have a linked branch.`,
Args: cobra.MaximumNArgs(1),  
RunE: func(cmd *cobra.Command, args []string) error {  
return submitTrailApproval(cmd.Context(), cmd.OutOrStdout(), trailInsecureHTTP(cmd),
return submitTrailApproval(cmd.Context(), cmd.OutOrStdout(), cmd.ErrOrStderr(), trailInsecureHTTP(cmd),
trailRepoFlag(cmd), selectorFromArgs(args), branch, "APPROVE", message, "Approved")
},
}

func runTrailApprovals(ctx context.Context, w io.Writer, insecureHTTP bool, repoOverride, selector, branch string, jsonOut bool) error {  
func runTrailApprovals(ctx context.Context, w, errW io.Writer, insecureHTTP bool, repoOverride, selector, branch string, jsonOut bool) error {  
if selector != "" && strings.TrimSpace(branch) != "" {
return errors.New("pass a trail selector or --branch, not both")
}
return runAuthenticatedTrailAPI(ctx, w, insecureHTTP, repoOverride, func(ctx context.Context, client *api.Client) error {
// Auth/not-logged-in messages go to stderr; w carries command output only.
return runAuthenticatedTrailAPI(ctx, errW, insecureHTTP, repoOverride, func(ctx context.Context, client *api.Client) error {
found, forge, owner, repoName, err := resolveNumberedTrail(ctx, client, repoOverride, selector, branch)
if err != nil {
return err
}
//Additional contents omitted for brevity.