Skip to content

Token tracking shows 0 despite long execution #23

@landigf

Description

@landigf

Bug description

After a step runs for 241 seconds, the token tracking shows 0 in / 0 out and cost $0.0000.

[claudeflow] ✗ failed in 241348ms
[claudeflow] Tokens: 0 in / 0 out
[claudeflow] Cost: $0.0000

Expected behavior

Even if the step fails, token usage should be captured from Claude's response, since Claude clearly did work (it ran for 4 minutes reading files with tools).

Root cause hypothesis

When Claude returns an empty result (see #1), the JSON response parsing likely fails entirely, losing the usage field along with the result. The token/cost tracking should be resilient to partial failures — capture usage even when the result text is empty or schema validation fails.

Suggested fix

Parse usage from Claude's response independently of the result field. Even on failure, report actual tokens consumed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions