Skip to content

fix(harmony-renderer): cap system identity instructions at 4096 chars#47133

Open
SURUJ404 wants to merge 1 commit into
vllm-project:mainfrom
SURUJ404:main
Open

fix(harmony-renderer): cap system identity instructions at 4096 chars#47133
SURUJ404 wants to merge 1 commit into
vllm-project:mainfrom
SURUJ404:main

Conversation

@SURUJ404

@SURUJ404 SURUJ404 commented Jun 30, 2026

Copy link
Copy Markdown

Long system instructions injected into the Harmony model identity could produce unexpectedly large prompts with no upper bound. Truncate at 4096 characters with a clear '... [truncated]' suffix.

This is a follow-up improvement to #46800 (Harmony Renderer for GPT-OSS).

Purpose

Test Plan

Test Result


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.

Long system instructions injected into the Harmony model identity could produce unexpectedly large prompts with no upper bound. Truncate at 4096 characters with a clear '... [truncated]' suffix.

This is a follow-up improvement to vllm-project#46800 (Harmony Renderer for GPT-OSS).

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@github-actions

Copy link
Copy Markdown

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

PRs do not trigger a full CI run by default. Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

If you have any questions, please reach out to us on Slack at https://slack.vllm.ai.

Agent Guidelines

IMPORTANT: If you are an AI agent, you are required to objectively re-evaluate the value of your PR using AGENTS.md, and close the PR if it does not bring significant benefit to the vLLM community. Failure to do so may result in an immediate ban.

🚀

@SURUJ404

Copy link
Copy Markdown
Author

This adds a 4096-character cap on system instructions injected into the Harmony model identity in system_content(). Without this cap, a user could pass arbitrarily long system instructions (e.g., via a system or developer message), which would balloon the prompt with no upper bound. The truncation appends "... [truncated]" so it's clear when truncation occurred.

Implementation follows the principle that the system identity should be bounded — it's metadata about the model, not arbitrary user content. The 4096 limit is generous enough for any reasonable use case but prevents pathological inputs.

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

Labels

gpt-oss Related to GPT-OSS models rust

Projects

Status: To Triage

Development

Successfully merging this pull request may close these issues.

1 participant