Skip to content

fix(sdk): preserve full title-generation inputs - #6337

Open
smolpaws wants to merge 2 commits into
OpenHands:mainfrom
smolpaws:feat/title-input-limits
Open

smolpaws wants to merge 2 commits into
OpenHands:mainfrom
smolpaws:feat/title-input-limits

Conversation

@smolpaws

@smolpaws smolpaws commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

HUMAN:

2,000 characters seems low to me, and I see in the file you shared truncate at 1000 🤔

Remove limits please. It’s a user message, it’s typically fairly small anyway, and even if it isn’t, this is once per conversation.

Then lets test the override properly. Make multiple tests, evaluating the rules. Give me a page on enyst io with nicely visualized results


AGENT:

Two Judges, Four Title Rules — Codex and Jev

288 new titles, a fixed Topic — action prompt, and two blinded judges. Both favor front-loading; collection consistency remains disputed. All raw grades and 47 disagreements are visible, with no adjudication.

Topic-First Titles — Follow-Up with GPT-6 Luna

432 attempts across three models and three prompts. Better front-loading, weaker collection consistency; the first experiment remains unchanged.

Readable Conversation Titles — 128 Real-Model Results

Two models, five writing principles, all outputs, and an explicit audit of scoring corrections. The override improves some outcomes and worsens others.

Why

Closes #6336. Title generation silently discarded first-message content after 1,000 characters and rejected instruction overrides longer than 2,000 characters. A task's decisive request can appear after that truncation point.

Summary

  • Remove both title-generation input caps. Default and custom prompts receive the full first user message.
  • Preserve the output title-length limit, emoji defaults, override placeholders, error handling, and fallback behavior.
  • Add regression coverage for real HTTP transport, long overrides, JSON round-tripping, and schema validation. No dependency changes.

Issue Number

Closes #6336.

How to Test

Run pytest tests/sdk/conversation/test_generate_title.py tests/agent_server/test_auto_title_span_metadata.py from a configured workspace.

Verified locally: 27 passed. All five new regression cases fail against the original source, then pass with this patch. The four input-preservation cases use the real SDK/LiteLLM HTTP transport against the existing local provider fixture; no SDK mocks were added. The configuration case validates an oversized override and its actual JSON round-trip/schema. Existing title tests cover output limits and fallbacks.

Test environment: isolated Python 3.13 environment using the repository's locked dependencies except user-approved LiteLLM 1.105.6 instead of workspace pin 1.105.1. Repository dependency files and existing environments are unchanged. Ruff and git diff --check pass. Full repository suite not run.

Video/Screenshots

Nonvisual SDK change. Regression evidence above; a separate synthetic real-model comparison evaluates title-prompt quality, not the input-cap regression.

Design Doc

Not needed for removing two input restrictions. Model context-window and provider request-size limits still apply.

Type

  • Bug fix
  • Feature
  • Refactor
  • Breaking change
  • Docs / chore

Notes

Paired documentation PR: OpenHands/docs#1053. Generated FastAPI StartConversationRequest OpenAPI schema also verified to have no prompt maxLength. The separate readable-text skill PR is OpenHands/extensions#871 and is not part of this change. TypeScript already represents this input as an unrestricted string.

This PR was created by an AI agent (OpenHands/SmolPaws) on behalf of Engel Nyst. The HUMAN section is reserved for the human author.

Co-authored-by: openhands <openhands@all-hands.dev>
@smolpaws
smolpaws marked this pull request as ready for review October 30, 2026 06:44
@enyst
enyst requested a review from all-hands-bot October 30, 2026 06:44

@all-hands-bot all-hands-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This review was posted by an AI agent (OpenHands).

Scope

This change belongs in this repository: it removes the two title-generation input caps in openhands-sdk/openhands/sdk/conversation/request.py (ConversationConfig.prompt) and openhands-sdk/openhands/sdk/conversation/title_utils.py (generate_title_with_llm), matching linked issue #6336 (labeled ready-for-dev). Cross-repository boundaries are respected — the readable-text skill stays in OpenHands/extensions#871 and the results page lives outside SDK source.

Verification

  • All GitHub Actions checks pass on head 01bb167b04c00afc4d781f198fd8941a543eb266, including sdk-tests, agent-server-tests, cross-tests, security, OpenAPI schema, REST/SDK breakage gates, and the TypeScript endpoint audit.
  • Ran tests/sdk/conversation/test_generate_title.py (26 passed) and tests/agent_server/test_auto_title_span_metadata.py (1 passed) locally with the repository's locked dependencies (LiteLLM 1.105.1).
  • The five new regression cases fail against the base revision and pass on this head, which I verified by temporarily restoring the base versions of the two source files and re-running.

Findings

No material correctness, security, compatibility, or acceptance-criterion defects found:

  • All three prompt modes (default, {conversation_content} placeholder, appended content) now pass the complete first user message; output title-length capping, emoji defaults, reasoning stripping, on_error fallback, and truncation fallback are unchanged.
  • The relaxed validation flows through the real agent-server path: AutoTitleSubscriber → _generate_title_traced → generate_title_from_message with stored.prompt (StoredConversation extends ConversationConfig), so no wiring gap exists.
  • The generated TypeScript schema (clients/typescript/src/generated/agent-server-schema.ts) already shows the prompt field without a maxLength bound, consistent with the relaxed constraint and the passing OpenAPI/endpoint-audit checks.
  • Relaxing a validation bound is backward compatible: previously rejected overrides become valid and existing payloads load unchanged; no persisted-settings shape change, so no migration or golden fixture is required.
  • The new tests exercise the real SDK/LiteLLM HTTP transport against a local provider fixture rather than SDK mocks, which matches the repository's requirement that regression evidence reach the actual transport.
  • The remaining acceptance item (real-model evaluation against the readable-text principles with a visual results page) is published separately per the issue's own instruction and is not a code defect; the in-repo regression coverage for criteria 1–3 is complete on this head.

✅ APPROVED

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.

Remove auto-title prompt and input-message caps

4 participants