Skip to content

orders place --autoslice hides rejected child slices in human output #4

Closed

Description

@jay-tau

Type: bug · Area: CLI · Reported severity: high
Verification: re-checked by hand (code + mock_responses/autoslice_response.json)

Problem

After a live kite orders place --autoslice --confirm, human output prints success with the parent order ID only. The children array is never shown, so rejected slices are hidden and the exit code is 0.

Scenario

The official mock mock_responses/autoslice_response.json returns four children; the third is
{"error": {"error_type": "MarginException", "message": "Insufficient funds. Required margin is 228365.92 but available margin is 228358.50."}}.
The CLI prints ✓ Order submitted BUY <full qty> … and Order ID …, then exits 0. The user believes the full quantity was placed. Only --json shows children.

Where

Nothing outside the TUI handles children, and no CLI test covers autoslice.

Suggested fix

When children is present, render one line per slice (order ID or error), adjust the headline when any slice failed, and consider a non-zero exit code for partial failure. Add a tests/cli_output.rs fixture using the autoslice mock.


Found in a code review of 97c5bb4 (identical to upstream main at the time) on 2026-11-08. Line links point at that commit.

Activity

  1. added
    bugSomething isn't working
    verifiedRe-checked by hand against code or data
    area: cliNon-TUI command-line paths
    priority: P1Fix first: high-severity bugs
    and removed on Nov 8, 2026
  2. jay-tau commented on Nov 12, 2026

    @jay-tau
    OwnerAuthor

    Fixed upstream by zerodha#5 in zerodha@ee3bf08, which closed zerodha#4. Not released yet. The TUI has the same gap and isn't covered by that fix.

  3. jay-tau commented on Nov 12, 2026

    @jay-tau
    OwnerAuthor

    The TUI gap mentioned above is now zerodha#6, with a fix in zerodha#7.

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

    area: cliNon-TUI command-line pathsbugSomething isn't workingpriority: P1Fix first: high-severity bugsseverity: highReported severity: highverifiedRe-checked by hand against code or data

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions