Skip to content

fix(preprocessor): drop dead choice.stop_reason assignment - #9403

Closed
krishung5 wants to merge 1 commit into
mainfrom
krish/fix-stop-reason-compile-break
Closed

fix(preprocessor): drop dead choice.stop_reason assignment#9403
krishung5 wants to merge 1 commit into
mainfrom
krish/fix-stop-reason-compile-break

Conversation

@krishung5

@krishung5 krishung5 commented May 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Main HEAD currently fails to compile:

```
error[E0609]: no field `stop_reason` on type `&mut dynamo_protocols::types::ChatChoiceStream`
--> lib/llm/src/preprocessor.rs:1581
1581 | choice.stop_reason = None;
| ^^^^^^^^^^^ unknown field
= note: available fields are: `index`, `delta`, `finish_reason`, `logprobs`
```

Cause: two PRs landed today in a way that left the tree internally inconsistent —

The next commit on main (#9230 `8cee1e50e1`, "sglang 0.5.11 bump") only touched sglang/Dockerfile files, so the Pre Merge workflow's path filter skipped `rust-clippy`/`rust-tests` entirely. The broken combination landed silently and is now exposed on every downstream PR that triggers a fresh build (e.g. #9352).

Fix

Drop the orphaned assignment. The surrounding code already resets every remaining field on the struct.

Test plan

  • `cargo check -p dynamo-llm` — passes
  • preprocessor.rs grep `stop_reason` returns no matches
  • CI rust-clippy / rust-tests passes

🤖 Generated with Claude Code


Open in Devin Review

Summary by CodeRabbit

  • Bug Fixes
    • Improved stream cleanup logic to ensure reasoning content is properly cleared without leaving fragments in processed output.

Review Change Stack

#8119 removed `stop_reason` from `ChatChoiceStream` after #9058 had
already added an assignment to that field in the eof-flushed-buffers
fallback path. The next commit on main (#9230) only touched sglang
Dockerfile/templates, so path-filtered CI skipped rust-clippy, and
the broken combination landed silently. Any downstream PR that
triggers a fresh build hits:

  error[E0609]: no field `stop_reason` on type
  `&mut dynamo_protocols::types::ChatChoiceStream`
    --> lib/llm/src/preprocessor.rs:1581

The struct's per-field reset is otherwise complete; removing the
orphaned line is enough to restore main's compile.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@krishung5
krishung5 requested a review from a team May 11, 2026 22:25
@github-actions github-actions Bot added fix frontend `python -m dynamo.frontend` and `dynamo-run in=http|text|grpc` labels May 11, 2026
@krishung5 krishung5 closed this May 11, 2026
@krishung5
krishung5 deleted the krish/fix-stop-reason-compile-break branch May 11, 2026 22:25
@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e3865282-de96-4ec5-a7ac-096ad554d0ca

📥 Commits

Reviewing files that changed from the base of the PR and between 8cee1e5 and d86c19f.

📒 Files selected for processing (1)
  • lib/llm/src/preprocessor.rs

Walkthrough

lib/llm/src/preprocessor.rs modifies the EOF flush logic in strip_leading_reasoning_start_from_stream to clear additional delta fields (refusal and reasoning_content) when emitting buffered undecided initial chunks, preventing partial reasoning fragments from propagating to output.

Changes

Stream Delta Field Cleanup

Layer / File(s) Summary
EOF Buffer Flush with Delta Field Cleanup
lib/llm/src/preprocessor.rs
EOF flush path explicitly clears choice.delta.refusal and choice.delta.reasoning_content along with other reset fields before emitting reconstructed choice content.

🎯 1 (Trivial) | ⏱️ ~3 minutes

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix frontend `python -m dynamo.frontend` and `dynamo-run in=http|text|grpc` size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant