Skip to content

test-dflash.sh test 4b: SKIP hides a failed tool request and a wrong finish_reason #266

Closed

Description

@solderzzc

Found while reviewing #262 (merged as 7858bf5). Test 4b was added there to check that a tool call under --dflash arrives as tool_calls.

Behaviour. Test 4b in tests/test-dflash.sh only FAILs when the reply contains tool-call text. Every other outcome falls through to skip, and the script exits 0 when there are no failures. So these cases are reported as SKIP and do not fail the job:

  1. The tool request fails: HTTP 500, or the 180 s --max-time. curl -sf ... || echo "" leaves TOOL_RESP empty.
  2. The tool call is parsed (get_weather) but finish_reason is stop, which is the regression fix: roll the recurrent layers back after a partially accepted DFlash block, and parse tool calls under DFlash #262 fixes.
  3. Plain text with no tool-call shape. This one is an intended SKIP, because whether the model calls the tool is a capability.

Reproduction. I extracted the 4b block and ran it against a fake server that returns each case (scratch only):

fake server reply result exit
HTTP 500 SKIP 0
tool_calls with get_weather, finish_reason: "stop" SKIP 0
plain text SKIP 0

Case 2 is the regression the test is for, and it passes CI.

Suggested fix. Keep SKIP only for case 3:

if [ "$TOOL_NAME" = "get_weather" ] && [ "$TOOL_FINISH" = "tool_calls" ]; then
    pass "DFlash tool call parsed: tool_calls[0]=get_weather, finish_reason=tool_calls"
elif [ -z "$TOOL_RESP" ]; then
    fail "tool request failed (HTTP error or timeout)"
elif [ -n "$TOOL_NAME" ]; then
    fail "tool call parsed but finish_reason=$TOOL_FINISH"
elif echo "$TOOL_CONTENT" | grep -q "tool_call\|get_weather"; then
    fail "DFlash handed the tool call over as text: $(echo "$TOOL_CONTENT" | head -c 120)"
else
    skip "model did not emit a tool call (capability, not contract): $(echo "$TOOL_CONTENT" | head -c 80)"
fi

Severity: medium (a regression guard that cannot fail for the bug it was added for).

Activity

  1. added a commit that references this issue on Nov 17, 2026
    82e5916
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions