Skip to content

UN-3987 [FIX] Send LLMWhisperer V2 params under the correct names - #2236

Open
chandrasekharan-zipstack wants to merge 3 commits into
mainfrom
UN-3987-fix-line-splitter-strategy-key
Open

UN-3987 [FIX] Send LLMWhisperer V2 params under the correct names#2236
chandrasekharan-zipstack wants to merge 3 commits into
mainfrom
UN-3987-fix-line-splitter-strategy-key

Conversation

@chandrasekharan-zipstack

@chandrasekharan-zipstack chandrasekharan-zipstack commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

What

The LLMWhisperer V2 adapter's line splitter strategy setting has never been applied. Two breaks stacked:

  1. Config key mismatch. The adapter's JSON schema stores the choice under line_splitter_strategy, but WhispererConfig.LINE_SPLITTER_STRATEGY was "line_spitter_strategy", so config.get() never matched and the left-priority default was always used.
  2. Wrong wire param. That same misspelled key was passed as a whisper() kwarg, so the client sent query param line_spitter_strategy, which the service does not read and Flask drops silently.

Fixing either alone changes nothing.

Changes

  • LINE_SPLITTER_STRATEGY is now "line_splitter_strategy" — matches the schema key and the wire param.
  • WhispererConfig gains PAGE_SEPARATOR_PARAM and FILE_NAME for the client kwarg names. page_seperator stays as the config key (existing adapter configs in the DB are stored under it, no migration needed) but is now sent as page_separator.
  • file_name is now sent, set to the basename of the file being extracted. Previously the adapter never sent it, so every Unstract-originated row in LLMWhisperer usage reports showed the service default. Separate commit if you'd rather drop it.
  • llmwhisperer-client pinned to >=2.8.0.

Blocked on the client release

>=2.8.0 does not exist yet — it is the release that carries Zipstack/llm-whisperer-python-client#34, which adds the correctly-named line_splitter_strategy, page_separator and file_name kwargs. On an older client these kwargs raise TypeError, so this must not merge before that release. Draft until then. On un-drafting: confirm the actual version number and regenerate the lockfiles.

Ordering: unstract-llm-whisperer#721 (service accepts page_separator) → llm-whisperer-python-client#34 release → this PR.

Behaviour change to expect

The service validates the strategy and returns 400 for anything outside left-priority / right-priority / mid-priority. Previously an out-of-range value was silently ignored, so a bad stored value becomes a hard error once the value actually arrives.

Users who never touched the setting are unaffected — adapter, client and service all default to left-priority.

Verification

tests/test_llm_whisperer_v2_params.py — 2 tests, both pass: the strategy is read from the schema key, and the page separator is read from the legacy config key but emitted under the corrected kwarg.

Not verified end to end: the extraction-output change needs the client release and a run against a deployed service.

Jira: UN-3987, LW-406

🤖 Generated with Claude Code

https://claude.ai/code/session_01Dra3Xevzb5oYtMz9fhj8iG

The adapter read the line splitter strategy under `line_spitter_strategy`
while its JSON schema stores it as `line_splitter_strategy`, so the user's
choice never applied. The same misspelling was also passed to the client,
which forwarded a query param the service does not read.

The page separator keeps its misspelled config key since existing adapter
configs are stored under it, but is now sent under the client's corrected
kwarg. Both need llmwhisperer-client 2.8.0 or newer.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dra3Xevzb5oYtMz9fhj8iG
Without it, usage reports record the service default for every
Unstract-originated extraction, leaving no way to cross reference a row
back to a document.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dra3Xevzb5oYtMz9fhj8iG
@chandrasekharan-zipstack
chandrasekharan-zipstack force-pushed the UN-3987-fix-line-splitter-strategy-key branch from 151b688 to 8b74d6f Compare August 11, 2026 08:39
@chandrasekharan-zipstack
chandrasekharan-zipstack marked this pull request as ready for review August 12, 2026 11:46
@sonarqubecloud

Copy link
Copy Markdown

@greptile-apps

greptile-apps Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR corrects LLMWhisperer V2 configuration-to-client parameter names, forwards the source basename for reporting, and raises the minimum client version. It also regenerates several service lockfiles, but leaves the independently versioned SDK lockfile stale.

  • Corrects line_splitter_strategy and maps legacy page_seperator configuration to page_separator.
  • Adds file_name to extraction requests.
  • Raises llmwhisperer-client to 2.8.0 and updates service lockfiles.
  • Adds focused parameter-mapping tests.

Confidence Score: 4/5

The stale unstract/sdk1 lockfile must be regenerated before merging so frozen SDK builds do not fail or retain the incompatible 2.6.2 client.

The corrected adapter call requires client 2.8.0, but the SDK project's committed lockfile still encodes client 2.6.2 and the old dependency constraint.

Files Needing Attention: unstract/sdk1/pyproject.toml and unstract/sdk1/uv.lock

Important Files Changed

Filename Overview
unstract/sdk1/pyproject.toml Raises the client minimum correctly, but the SDK project's own uv.lock remains pinned to 2.6.2.
unstract/sdk1/src/unstract/sdk1/adapters/x2text/llm_whisperer_v2/src/constants.py Corrects the strategy key and separates the legacy stored page-separator key from the client parameter name.
unstract/sdk1/src/unstract/sdk1/adapters/x2text/llm_whisperer_v2/src/helper.py Emits corrected client kwargs and adds the input basename to extraction requests; behavior depends on installing client 2.8.0.
unstract/sdk1/tests/test_llm_whisperer_v2_params.py Covers strategy and legacy page-separator mapping, though it does not exercise the downstream client call.
backend/uv.lock Regenerates the backend lock and resolves llmwhisperer-client 2.8.0, with substantial incidental lock-format churn.
platform-service/uv.lock Regenerates the service lock and updates the SDK client dependency.
unstract/filesystem/uv.lock Regenerates the filesystem lock and updates the transitive SDK client dependency.
workers/uv.lock Updates the worker lock to llmwhisperer-client 2.8.0.

Fix All in Claude Code

Prompt To Fix All With AI
### Issue 1
unstract/sdk1/pyproject.toml:50
**SDK lock retains incompatible client**

When `unstract/sdk1` is installed from its own lockfile, the lock still resolves `llmwhisperer-client` 2.6.2 despite this new `>=2.8.0` requirement. Frozen installation therefore rejects the stale lock, while workflows that install from it without synchronization retain a client that does not support the newly forwarded `line_splitter_strategy`, `page_separator`, and `file_name` arguments, causing V2 extraction calls to fail.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "Commit uv.lock changes" | Re-trigger Greptile

"redis>=5.2.1",
# # LLMWhisperer client
"llmwhisperer-client>=2.6.2",
"llmwhisperer-client>=2.8.0",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 SDK lock retains incompatible client

When unstract/sdk1 is installed from its own lockfile, the lock still resolves llmwhisperer-client 2.6.2 despite this new >=2.8.0 requirement. Frozen installation therefore rejects the stale lock, while workflows that install from it without synchronization retain a client that does not support the newly forwarded line_splitter_strategy, page_separator, and file_name arguments, causing V2 extraction calls to fail.

Knowledge Base Used: Unstract SDK, Core, and Flags

Prompt To Fix With AI
This is a comment left during a code review.
Path: unstract/sdk1/pyproject.toml
Line: 50

Comment:
**SDK lock retains incompatible client**

When `unstract/sdk1` is installed from its own lockfile, the lock still resolves `llmwhisperer-client` 2.6.2 despite this new `>=2.8.0` requirement. Frozen installation therefore rejects the stale lock, while workflows that install from it without synchronization retain a client that does not support the newly forwarded `line_splitter_strategy`, `page_separator`, and `file_name` arguments, causing V2 extraction calls to fail.

**Knowledge Base Used:** [Unstract SDK, Core, and Flags](https://app.greptile.com/zipstack/-/custom-context/knowledge-base/zipstack/unstract/-/docs/unstract-sdk-core.md)

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Fix in Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

Unstract test results

Per-group results

Status Group Tier Passed Failed Errors Skipped Duration (s)
integration-backend integration 267 0 0 26 44.5
integration-connectors integration 1 0 0 7 8.3
integration-workers integration 140 0 0 1 49.8
unit-backend unit 998 0 0 1 39.1
unit-connectors unit 63 0 0 0 9.6
unit-core unit 33 0 0 0 1.3
unit-platform-service unit 15 0 0 0 2.5
unit-rig unit 117 0 0 0 5.3
unit-sdk1 unit 482 0 0 0 30.6
unit-workers unit 1335 0 0 1 85.5
TOTAL 3451 0 0 36 276.5

Critical paths

⚠️ Critical paths not yet covered

  • workflow-execution-fan-out — Multi-file workflow execution fans out to file-processing workers and rejoins. (declared coverage: no groups declared)
💤 Covered, but not exercised in this build
  • auth-login — User can log in and obtain a session cookie. (covered by e2e-login; no result reported in this build)
  • workflow-create-execute — Create a workflow, configure source+destination, execute, poll, fetch result. (covered by e2e-workflow; no result reported in this build)
  • api-deployment-run — Deploy a workflow as an API, POST a document, receive structured JSON. (covered by e2e-api-deployment; no result reported in this build)
  • prompt-studio-fetch-response — Prompt Studio: create project, add prompt, run a prompt, get response. (covered by e2e-prompt-studio; no result reported in this build)
  • pipeline-etl-execute — Run an ETL pipeline from source connector to destination. (covered by e2e-etl; no result reported in this build)
  • usage-token-tracking — Per-execution token usage is recorded and retrievable. (covered by e2e-api-deployment; no result reported in this build)
  • callback-result-delivery — Async results are posted back via the callback worker. (covered by e2e-api-deployment; no result reported in this build)
✅ Covered critical paths
  • adapter-register-llm — covered by integration-backend
  • workflow-author — covered by integration-backend
  • co-owner-manage — covered by integration-backend
  • api-deployment-provision — covered by integration-backend
  • api-deployment-auth — covered by integration-backend
  • mcp-server-auth — covered by integration-backend
  • mcp-platform-auth — covered by integration-backend
  • prompt-studio-author — covered by integration-backend
  • connector-register-test — covered by integration-backend
  • usage-aggregate-read — covered by integration-backend

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