Skip to content

fix(inference): forward max_tokens & extra_body in crop-describe#68

Merged
Liuhaai merged 1 commit into
mainfrom
fix/crop-describe-forward-max-tokens-extra-body
May 18, 2026
Merged

fix(inference): forward max_tokens & extra_body in crop-describe#68
Liuhaai merged 1 commit into
mainfrom
fix/crop-describe-forward-max-tokens-extra-body

Conversation

@Liuhaai

@Liuhaai Liuhaai commented May 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add max_tokens and extra_body fields to CropDescribeRequest and forward them to engine.analyze_frame.
  • Fixes silent truncation: the engine default max_tokens=512 is too small for the structured-JSON scene schema; cortex logged 2131 Expecting , delimiter JSON parse failures over a single night.
  • Matches what /describe at the same router already does.

Test plan

  • New unit test asserts max_tokens=4096 and extra_body={"enable_thinking": False} reach analyze_frame
  • Existing crop-describe tests still pass

🤖 Generated with Claude Code

CropDescribeRequest accepted neither field, so the router silently
fell back to the engine default max_tokens (512). That is too small
for the structured-JSON scene schema and truncated responses
mid-output — cortex logged 2131 "Expecting , delimiter" parse
failures over a single night.

Adds both fields to the request schema and forwards them to
engine.analyze_frame, matching what /describe at the same router
already does.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@Liuhaai Liuhaai merged commit 6fa0d41 into main May 18, 2026
7 checks passed
@Liuhaai Liuhaai deleted the fix/crop-describe-forward-max-tokens-extra-body branch May 18, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant