Skip to content

fix(client): support chunk updates without overwriting omitted fields - #6244

Open
Yzzz88 wants to merge 1 commit into
Tencent:mainfrom
Yzzz88:fix/client-partial-chunk-updates
Open

Yzzz88 wants to merge 1 commit into
Tencent:mainfrom
Yzzz88:fix/client-partial-chunk-updates

Conversation

@Yzzz88

@Yzzz88 Yzzz88 commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Description

The server supports editing only a document chunk's text or retrieval state, but the SDK's legacy update request has value fields: a text edit always sends is_enabled:false, and an enable-only update sends an empty content string that the server rejects. This makes ordinary correction and enable/disable workflows unsafe without copying unrelated values first.

Add UpdateChunkFields with pointer-valued content, enabled state, and revision fields matching the server contract. Nil preserves a stored field; a pointer to false explicitly disables it; revision zero is transmitted when supplied. Reuse the existing request path/response handling and retain the legacy method's signature and behavior for compatibility. Both READMEs show reading the current revision and making an enable-only update.

Testing

Three HTTP-transport cases exercise the real SDK method and the server's pointer-field decoding: content-only, disable-only, enable-only, omitted fields, and expected revision zero. All pass. go test -count=1 ./... passes for the complete client module, and golangci-lint v2.12.2 reports zero diff-scoped issues. git diff --check passes. No live backend or paid model was used.

Existing callers must opt into the new method for partial-update semantics; this PR deliberately does not change what legacy value fields mean.

This branch has not been deployed

No deployments
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