Commit Graph

383 Commits

Author SHA1 Message Date
Lynn
15f8ef7409 Fix: code review (#17442) 2026-07-28 09:47:22 +08:00
Jin Hai
1436fcaca5 Go: add context, part13 (#17445)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-27 21:19:39 +08:00
Jin Hai
f73f4cb720 Go: add context, part12 (#17435)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-27 19:30:41 +08:00
euvre
246c40c4e6 fix: show resolved embedding model display name in dataset list (#17415) 2026-07-27 19:09:16 +08:00
Jin Hai
19d861b797 Go: add context, part11 (#17426)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-27 17:48:44 +08:00
euvre
30b40caff8 Fix agentbot embedded chat streaming envelope (#17420) 2026-07-27 17:39:44 +08:00
Jin Hai
49e6181eca Go: add context, part10 (#17417)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-27 16:14:23 +08:00
Jin Hai
3065a29935 Go: add context, part9 (#17412)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-27 15:06:48 +08:00
Lynn
9bec8d12bb Fix: simplify verify go (#17397) 2026-07-27 13:54:36 +08:00
Jin Hai
f5aa5f7d94 Go: context, part8 (#17405)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-27 13:38:15 +08:00
Jin Hai
1571abd98a Go: add context, part7 (#17402)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-27 11:23:06 +08:00
Jin Hai
9d4847beaf Go: add context, part6 (#17399)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-27 11:09:17 +08:00
Wang Qi
53afc32349 Fix get datasets owner retrieve the whole dataset (#17370) 2026-07-27 10:24:13 +08:00
Jin Hai
f53518c110 Go: add context, part5 (#17392)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-27 10:20:16 +08:00
Jin Hai
53e83dcadf Go: add context, part4 (#17381)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-26 18:31:56 +08:00
Jin Hai
cc1eb6fb58 Go: add context, part3 (#17369)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-24 22:00:09 +08:00
Jin Hai
d9e359d481 Go: add context (#17354)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-24 20:19:41 +08:00
Haruko386
0471fd5695 fix: unable to add metadata in dataset (#17359)
### Summary

As title
2026-07-24 19:33:13 +08:00
Hz_
601742e000 fix(go-agent): message double (#17353)
## Summary

- Preserve all streamed Agent deltas when Message consumes deferred
output.
- Prevent duplicate final answers while keeping Agent and Message event
ordering consistent.
- Add regression coverage for complete deferred streaming output.

## Testing

- `CGO_ENABLED=0 go test ./internal/agent/component
./internal/agent/runtime -count=1`
2026-07-24 19:23:51 +08:00
Jin Hai
bdfc3ada41 Go: add context (#17314)
### Summary

As title.

---------

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-24 16:47:12 +08:00
futurehua
bd355deaa9 refactor: use the built-in max/min to simplify the code (#17059)
### Summary

In Go 1.21, the standard library includes built-in
[max/min](https://pkg.go.dev/builtin@go1.21.0#max) function, which can
greatly simplify the code.

Signed-off-by: futurehua <futurehua@outlook.com>
2026-07-24 15:33:02 +08:00
Haruko386
347d8f2b5f fix: not sorted when list chunks (#17329)
### Summary

As title, sorted now
2026-07-24 12:07:43 +08:00
euvre
86530931fe fix(agent): set exp_user_id and name on session creation so exploration shows session titles (#17327) 2026-07-24 11:36:20 +08:00
Haruko386
74218bdd6a fix: search chunk cannot get result (#17328) 2026-07-24 11:01:30 +08:00
euvre
99bea630b0 fix: agent session round count not incremented in Go mode (#17295) 2026-07-24 09:53:58 +08:00
Jin Hai
61201e437d Go: fix context (#17277)
### Summary

Continue to add context

---------

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-23 21:48:54 +08:00
euvre
4dfa5b145b fix: chat attachments not used in Go mode (#17259) 2026-07-23 20:24:13 +08:00
Jack
d12fd3b79d feat: parser pages range and parse type validation for dataset/document (#17293)
## Summary

Adds page-range parsing support to the Go-native pipeline path and
introduces strict `parse_type` validation for both dataset and document
update endpoints.

## What changed

### Pages range parsing
- **`internal/utility/pdf_pages.go`** — `NormalizePDFPages`: normalizes
raw page ranges (list of `[from,to]` 1-indexed inclusive ranges) into
sorted, merged, deduplicated `[][]int`. Invalid ranges are dropped.
- **`internal/ingestion/pipeline/pdf_pages.go`** —
`NormalizeParserConfigPages`: walks any parser_config map and normalizes
`"pages"` values under every component → filetype setup, so the
persisted config always carries clean, merged ranges.
- **`internal/deepdoc/parser/pdf/parser.go`** — integrates
`resolvePagesToProcess` to filter parsed PDF pages by the configured
ranges.
- Pipeline integration (parser pages):
`internal/parser/parser/pdf_parser_common.go`, `chunk_process.go`, plus
associated e2e and unit tests.

### Parse type validation (shared logic)
- **`internal/service/parser_mode.go`** (new) — `ValidateParseTypeMode`:
shared function that validates `parse_type` (1=BuiltIn/parser_id,
2=Pipeline/pipeline_id) and ensures the corresponding field is present.
Used by both dataset and document update endpoints.
- **`internal/service/dataset/crud.go`** / `update.go` — replaces inline
`isPipelineMode`/`isBuiltinMode` computation with the shared
`service.ValidateParseTypeMode`.
- **`internal/service/document/document_dataset_update.go`** — adds
strict `parse_type` validation in `validateDatasetDocumentUpdate`,
simplifies the reparse logic to a two-way switch (isBuiltin/isPipeline)
now that parse_type is always valid.
- **`internal/service/document/document.go`** — adds `ParseType` field
to `UpdateDatasetDocumentRequest`.
- **`internal/service/document/document_dataset_update.go`** —
`updateDocumentParserConfig` fallback path when DSL loading fails.
- **`internal/service/parser_mode_test.go`** (new) — test coverage for
nil, invalid, and missing-field scenarios.

### Frontend
- **`web/src/interfaces/request/document.ts`** — adds `parseType` to
`IChangeParserRequestBody`.
- **`web/src/hooks/use-document-request.ts`** —
`useSetDocumentPipelineParser` sends `parse_type` in the PATCH payload.
- **`web/src/pages/dataset/dataset/use-change-document-parser.ts`** —
Go/Python branching for the document parser config dialog.
-
**`web/src/components/document-pipeline-dialog/use-document-pipeline-form.ts`**
— `buildSubmitData` returns `parseType` (bugfix: was dropped from the
return value).

### Test changes
- **Removed**: 2 tests that verified the old "mutually exclusive" error
(replaced by `ValidateParseTypeMode` coverage).
- **Modified**: 6 tests across document and dataset packages to include
`ParseType` in request structs.
- **Added**: new e2e tests for pages parsing (`pages_e2e_test.go`,
`pdf_parser_pages_e2e_test.go`) and unit tests for `NormalizePDFPages`,
`NormalizeParserConfigPages`, `resolvePagesToProcess`.

## Backward compatibility
- The `parse_type` field is **required** when `parser_id` or
`pipeline_id` is sent. This changes the contract for both dataset and
document PATCH endpoints, but aligns the Go backend with the existing
frontend behavior (the frontend already sends `parse_type`). Callers
that omit `parse_type` when updating parser/pipeline selections will
receive a clear error message.
- Existing callers that only update fields like `name`, `enabled`, or
`meta_fields` are unaffected.
- Test updates ensure all known call sites are compliant.
2026-07-23 19:57:27 +08:00
Lynn
c3e03f5c06 Fix: update base_url and model list for provider tencent Hunyuan (#17304) 2026-07-23 19:24:54 +08:00
Haruko386
5d8dfa610c fix: unable to get prologue in agent bot (#17299)
### Summary

As title
2026-07-23 19:13:45 +08:00
Lynn
4a2564c7da Feat: OpenAI-API-Compatible (#17276) 2026-07-23 13:39:57 +08:00
Jin Hai
5478f955ab Go: add context to DAO (#17269)
### Summary

DAO layer doesn't use context, this PR is to fix it.

---------

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-23 12:15:58 +08:00
euvre
7b29fc10ca fix(agent): wire memory persistence in Message component (Go runtime) (#17256) 2026-07-23 11:37:59 +08:00
euvre
db1559f71b fix: prevent thinking content from leaking into visible answer in shared chat (Go mode) (#17225) 2026-07-23 09:58:24 +08:00
Jin Hai
d19a036cda Go: add context to lots of interface (#17253)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-22 22:30:57 +08:00
Haruko386
29292e9622 fix: can get duplicate agent-name when update agent (#17232)
### Summary

As title
2026-07-22 21:27:25 +08:00
Haruko386
1d165c7315 fix: unable to get owner in chat and search (#17244)
### Summary

As title
2026-07-22 21:27:08 +08:00
Haruko386
48b63ab6b0 fix: cannot not show embed ID in listMemories (#17211)
### Summary

As title
2026-07-22 21:26:44 +08:00
euvre
11c08fe62e fix(go): resolve tenant model IDs in memory create/update without hard failure (#17176) 2026-07-22 19:34:41 +08:00
euvre
8408f9a4e2 Go: only unlink file-manager files when deleting documents from a knowledge base (#17175) 2026-07-22 12:14:22 +08:00
euvre
4697ee29aa fix: avoid duplicate document names when linking files to datasets (#17181) 2026-07-22 12:12:23 +08:00
euvre
fe3e87361d fix(agent): restrict permission field edits to canvas owner only (#17185) 2026-07-22 12:09:22 +08:00
euvre
03e583f9bc fix: add create_date field to APIKeyResponse for token list display (#17186) 2026-07-22 12:08:16 +08:00
Haruko386
b9de586043 fix: add accessible check for datasets (#17116)
### Summary

As title:

Some operations on datasets have been fixed as they previously lacked
authentication, preventing team members from proper or correct usage.

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-07-21 19:20:56 +08:00
Lynn
340d30eb12 Fix: verify model api (#17183) 2026-07-21 19:09:46 +08:00
euvre
3f9d9529b3 fix(file2document): batch link should add to existing KBs, not replace them (#17172) 2026-07-21 19:05:02 +08:00
Lynn
3f5b765a5f Fix(go): check model availability (#17156) 2026-07-21 19:02:14 +08:00
qinling0210
edeb47cd54 Implement Tagger in Extractor component in GO (#17128)
### Summary

Implement Tagger in Extractor component in GO
2026-07-21 17:52:06 +08:00
Haruko386
08ed962aed fix: Refactor ListConnectors to validate userID and simplify logic (#17152)
### Summary

Trim whitespace from userID and check for empty value. Use userID
directly for listing connectors instead of tenant ID.
2026-07-21 16:47:28 +08:00
euvre
87417d083e Go: disable thinking for search ask summary to fix truncated AI summary (#17155) 2026-07-21 14:54:14 +08:00