Skip to content

fix(client): retain document tags and custom metadata - #6179

Merged
lyingbug merged 2 commits into
Tencent:mainfrom
Yzzz88:fix/client-document-classification
Nov 30, 2026
Merged

lyingbug merged 2 commits into
Tencent:mainfrom
Yzzz88:fix/client-document-classification

Conversation

@Yzzz88

@Yzzz88 Yzzz88 commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Description

Go SDK integrations cannot read a document's multiple tags or business metadata: the server returns tags and custom_metadata, but the shared Knowledge response type only exposes the legacy singular tag ID. Document inventory/export and synchronization code silently loses those fields on GET, list, and batch reads.

Expose Tags using the existing Tag type and CustomMetadata as raw JSON, consistent with the existing Metadata field. This preserves arbitrary nested metadata without number coercion and leaves the legacy TagID available.

Type of Change

  • Bug fix
  • Test

Testing

Three regressions call the real SDK GET/list/batch methods through an HTTP transport returning the server's response shape. They failed on main because the tags were discarded. With the change, all three preserve multiple tag records, nested custom metadata, and the legacy tag ID.

go test -count=1 ./... in client/ passes in full (Windows, Go 1.26, CGO disabled). The first sandboxed attempt was denied local loopback access in unrelated HTTP tests; rerunning with loopback access passed. git diff --check passes.

@lyingbug
lyingbug merged commit 4af8cba into Tencent:main Nov 30, 2026
7 checks passed
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.

2 participants