Repository navigation
Fix: disable Ollama thinking for vision figure descriptions - #17031
iwasaki1112 wants to merge 1102 commits into
Conversation
### Summary Merge HTTP response functions into common/response.go --------- Signed-off-by: Jin Hai <[email protected]>
### Summary Remove redundant functions.
## Summary Debugging YahooFinance component in agent canvas returns "unknown component" and "no input_form". YahooFinance was only registered as an eino tool, not as a runtime component. The component factory only searches the runtime registry. - `universe_a_wrappers.go`: add `yahooFinanceComponent` wrapper delegating to `agenttool.YahooFinanceTool` with `GetInputForm()` - `fixture_stubs.go`: register `"YahooFinance"` component ## TEST `go build` and `go test ./internal/agent/component/...` all pass.
…nfiniflow#16675) ## Summary - Add Go dynamic input form support for ExeSQL and Browser components. - Align their input form metadata with the Python implementation. - Add regression tests for `/components/:component_id/input-form`.
…ow#16661) ### Summary Keep `data` as the uploaded document array when dataset document upload partially succeeds. This matches the Python API behavior and allows parse-on-creation to run for successfully uploaded files when other files in the same folder are unsupported.
Ports remaining Go parser wiring and PDF backends, adds tenant-aware VLM dispatch, aligns post-processing with Python, and adds end-to-end pipeline coverage with a generated six-page PDF.
…paginated envelope (infiniflow#16639)
…omitted (infiniflow#15484) ## Summary Closes infiniflow#15483. Default workflow/session agent completions to non-streaming when `stream` is omitted. ## Changes - `api/apps/restful_apis/agent_api.py`: `req.get("stream", False)` on workflow paths. ## Test plan - [ ] POST workflow completion without `stream`; assert JSON response.
## Summary Upgrade crawl4ai from 0.8.9 to 0.9.0 to fix GHSA-r253-r9jw-qg44. ## Vulnerability | Field | Value | |-------|-------| | **ID** | GHSA-r253-r9jw-qg44 | | **Severity** | CRITICAL | | **Scanner** | trivy | | **Rule** | `GHSA-r253-r9jw-qg44` | | **File** | `uv.lock` | | **Assessment** | Likely exploitable | **Description**: Crawl4AI: Unauthenticated RCE via Chromium launch-argument injection in browser_config.extra_args ## Evidence **Scanner confirmation**: trivy rule `GHSA-r253-r9jw-qg44` flagged this pattern. **Production code**: This file is in the production codebase, not test-only code. ## Threat Model Context This is a web service - vulnerabilities in request handlers are directly exploitable by remote attackers. ## Changes - `pyproject.toml` - `uv.lock` ## Verification - [x] Build passes - [x] Scanner re-scan confirms fix - [x] LLM code review passed --- *This change addresses a pattern flagged by static analysis. The code path handles user-influenced input and the fix reduces the attack surface against both manual and automated exploitation.* --- *Automated security fix by [OrbisAI Security](https://orbisappsec.com)* Co-authored-by: Ling Qin <[email protected]>
### Motivation This PR evolves the harness from a pure execution runtime into an **observable, replayable agent evaluation platform**. The current `harness/graph` checkpoint mechanism is insufficient for true event-sourced introspection—we need append-only event logs capturing every tool call, state transition, memory write, and approval decision, enabling deterministic replay, fork/diff, postmortem analysis, and time-travel debugging. ### Key Design Goals 1. **Event-Sourced Execution Model** Replace coarse checkpoints with granular, append-only event logs. Every operation becomes a durable event: tool invocation, state mutation, memory update, human approval. This unlocks deterministic replay, branching execution histories, and regression datasets derived directly from production failures. 2. **First-Class Replay & Evaluation Loop** Replay is not an afterthought—it is a core primitive. A single live run seeds an offline corpus that supports: repeated playback, model substitution, tool result mocking, and strategy comparison. The harness graduates from "executor" to "continuous evaluation platform" where failed production traces convert directly into offline regression suites. 3. **Operational Observability** Beyond raw traces, expose metrics that prove stability over time: - Tool success / failure rates - Approval latency distributions - Retry frequencies - Checkpoint restore reliability - Memory retrieval quality - Cost per completed task - Fork replay pass rates The underlying thesis: the bottleneck for most agent systems is not execution capability, but the inability to **demonstrate continuous, measurable improvement**. ### Type of change - [x] New Feature (non-breaking change which adds functionality)
…flow#14140) ## Summary - Add language-aware Snowball stemmer to `RagTokenizer` supporting 16 languages (Dutch, German, French, Spanish, etc.) - Thread the KB `language` parameter through the full tokenization pipeline (14 parser modules + task executor) - Add Dutch to the frontend language lists and cross-language form ## Problem RAGFlow uses the English Porter stemmer + WordNet lemmatizer for **all** BM25 tokenization, regardless of the knowledge base language setting. This produces incorrect stems for non-English text. For example: | Dutch word | Dutch stemmer | English Porter | |---|---|---| | documenten | document | documenten (unchanged!) | | gebruikers | gebruiker | gebruik (over-stemmed) | | instellingen | instell | instellingen (unchanged!) | This degrades BM25 recall for any non-English knowledge base. ## Solution NLTK already ships Snowball stemmers for 16 languages. This PR: 1. **`rag/nlp/rag_tokenizer.py`**: Overrides `tokenize()` with `set_language()` and `_normalize_token()` that selects the correct NLTK Snowball stemmer. Falls back to Porter for unmapped languages (Chinese, Japanese, Korean, etc. — these use character-based tokenization anyway). 2. **`rag/nlp/__init__.py`** + **14 `rag/app/*.py` parsers** + **`rag/svr/task_executor.py`**: Threads the `language` parameter through `tokenize()`, `tokenize_chunks()`, `tokenize_table()`, and all callers. 3. **Frontend**: Adds Dutch (`Nederlands`) to `LanguageList`, `LanguageMap`, `LanguageAbbreviationMap`, `LanguageTranslationMap`, cross-language form field, and `en.ts` locale. ## Backward Compatibility - Default language is `"English"`, preserving existing behavior for all current users - Languages without a Snowball stemmer mapping fall back to Porter (no change) - No new dependencies — NLTK Snowball is already bundled
…s for model IDs containing '@' (infiniflow#16467) (infiniflow#16468)
…#16682) ## Summary Fixes a page crash when opening the BGPT node configuration in the canvas. ## Root Cause BGPT was using the tool-form watcher call pattern in a normal canvas component form. Tool forms use: useWatchFormChange(form) Canvas component forms use: useWatchFormChange(node?.id, form) Tool is not equal to component. The BGPT canvas component imported the component-level hook but called it like a tool-form hook, so the form argument became undefined and React Hook Form tried to read control from a null context. ## Change Updated the BGPT canvas form to pass the node id and form instance correctly. ## Validation Ran ESLint for the changed file: npx eslint src/pages/agent/form/bgpt-form/index.tsx <img width="1369" height="1184" alt="image" src="https://github.com/user-attachments/assets/a40c5202-7394-4f26-9da2-08329dcc7fbf" />
### Summary There is a [new function](https://pkg.go.dev/[email protected]#Contains) added in the go1.21 standard library, which can make the code more concise and easy to read. Signed-off-by: weifanglab <[email protected]>
## Summary Adds the missing input form metadata for the Go BGPT canvas component. ## Root Cause The standalone BGPT component was registered in Go, but it did not implement GetInputForm(). During component trial run, the backend asks the component for its input_form. Since BGPT had none, the API returned: component has no input_form: BGPT:<node_id> Python BGPT already exposes the query input form, so the Go component needed the same contract. ## Change Added GetInputForm() to the Go BGPT component with a single query line input. Added test coverage to ensure BGPT exposes the input form. ## Validation Backend: bash build.sh --test -run TestBGPT ./internal/agent/component <img width="1369" height="1184" alt="image" src="https://github.com/user-attachments/assets/f99e4a81-2359-42e5-80bb-dcc4e6a63fea" /> <img width="1736" height="1152" alt="image" src="https://github.com/user-attachments/assets/c11240a5-2c42-4d08-88e3-c6dfbf49eedb" />
### Summary The Go backend never seeded the `canvas_template` table, so the "Create agent from template" page was blank when the frontend proxies to the Go API (`API_PROXY_SCHEME=go`). This PR adds `SeedCanvasTemplates()` in `internal/dao`, invoked from `InitDB()` after migrations, which loads `agent/templates/*.json` and mirrors Python's `add_graph_templates()` behavior. Changes: - Add `internal/dao/canvas_template_seed.go` to parse and upsert built-in templates. - Call `SeedCanvasTemplates()` in `InitDB()`. - Add `CanvasTypes` (`JSONSlice`) to `entity.CanvasTemplate` so the frontend can filter/group by category. - Skip seeding gracefully when the templates directory is absent. This fixes the blank template catalogue in Go mode.
### Summary Add object as a begin-node parameter type with JSON editor UI, webhook schema support, and backend parsing in UserFillUp. Co-authored-by: Cursor <[email protected]>
Follow on this PR: infiniflow#15484 it break the Agent chat
…iflow#16687) Co-authored-by: noob <[email protected]>
### Summary 1. Change the CI trigger conditions. synchronize and labeled ci 2. Fix ci: tags canceled running workflow
### Summary Introduce Clickhouse for data statistics. Signed-off-by: Jin Hai <[email protected]>
### Summary As title related to infiniflow#16990
### Summary As Title <img width="3241" height="1934" alt="image" src="https://github.com/user-attachments/assets/cb22031c-f200-462a-b871-b4a739e7a66a" />
…finiflow#16892) ## Summary Update all `somark.tech` references to `somark.cn` (default for China) / `somark.ai` (for overseas including Taiwan, China; Hong Kong, China; Macau, China). Users fill in `base_url` manually — default is `somark.cn`. ### Changes | File | Change | |------|--------| | `constants.py` | Default → `somark.cn` | | `somark_parser.py` | SAAS_BASE_URL + fallback → `somark.cn` | | `ocr_model.py` | Default → `somark.cn` | | `pdf_parser_common.go` | Go default → `somark.cn` | | `llm.ts` | API key URL → `somark.cn` | | `en.ts` | Base URL descriptions + purchase URLs | | `zh.ts` | Base URL descriptions + purchase URLs | ### Purchase URLs - China: `https://somark.cn/workbench/purchase` - Overseas: `https://somark.ai/studio/purchase` --------- Co-authored-by: justinychuang <[email protected]> Co-authored-by: Jin Hai <[email protected]>
### Summary Tracing framework --------- Signed-off-by: Jin Hai <[email protected]>
### Summary Compilation result navigation in agentic search.
…low#16977) ### Summary Feat: Visualize session graph data using ArtifactForceGraph.
### Summary Remove below indexes. ``` idx_tenant_langfuse_secret_key idx_tenant_langfuse_public_key idx_tenant_langfuse_host ``` --------- Signed-off-by: Jin Hai <[email protected]>
… file when a link is clicked. (infiniflow#17019)
OllamaCV.describe()/describe_with_prompt() call the Ollama Python client's generate() without think=False. Ollama only honors think as a top-level kwarg (not inside options), so Qwen3-family vision models emit a full reasoning trace before the actual description. On an RTX 3070 with qwen3.5:9b this took ~6 minutes and ~2800 tokens per figure; disabling it drops that to 10-60s. The generate() think parameter needs ollama-python>=0.5.1; bump the pinned lower bound accordingly. Verified on a live deployment: figure descriptions during AI-OCR parsing dropped from ~6 min/figure to ~10-60s/figure after this change, confirmed across a full run over an 86-page PDF with 250+ figures.
📝 WalkthroughWalkthroughThe Ollama dependency minimum version is raised to 0.5.1, and both Ollama CV image-generation calls now pass ChangesOllama CV generation
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
rag/llm/cv_model.py (1)
778-789: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAdd regression coverage for both vision generation methods.
Mock
self.client.generateand assert that bothdescribe()anddescribe_with_prompt()passthink=Falseas a top-level keyword, while preserving response extraction. As per coding guidelines, “Preserve valid behavior with focused tests.”Also applies to: 795-806
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@rag/llm/cv_model.py` around lines 778 - 789, Add focused regression tests for the vision generation methods describe and describe_with_prompt, mocking self.client.generate and asserting each call passes think=False as a top-level keyword. Keep the existing response extraction assertions so the tests verify both the new argument and preserved output behavior.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@rag/llm/cv_model.py`:
- Around line 778-789: Add focused regression tests for the vision generation
methods describe and describe_with_prompt, mocking self.client.generate and
asserting each call passes think=False as a top-level keyword. Keep the existing
response extraction assertions so the tests verify both the new argument and
preserved output behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: fb29e814-3e91-4b51-bf3c-02111e9d97b3
📒 Files selected for processing (2)
pyproject.tomlrag/llm/cv_model.py
6ba3i
left a comment
There was a problem hiding this comment.
The Python fix looks good to me. think=False is applied at the right level and the dependency bump makes sense.
The one thing I think we still need is Go parity. Current main now has the same parser-side vision path in Go, but Ollama only serializes Thinking when it is true, so Thinking: false is effectively the same as leaving it unset. That means Qwen3/Qwen3.5 can still think by default there.
I’d update the Go Ollama driver to serialize any non-nil Thinking value, and have the vision invoker explicitly pass Thinking: false. The same should apply to streaming.
Also worth regenerating uv.lock after the minimum Ollama version bump.
Other than that, LGTM
|
Hello @iwasaki1112 could you please take a look at my comment fix the missing go implementation ? |
|
overlaps on #19529 |
Summary
OllamaCV.describe()/describe_with_prompt()call the Ollama Python client'sgenerate()withoutthink=False. Ollama only honorsthinkas a top-level kwarg (not insideoptions), so Qwen3-family vision models emit a full reasoning trace before the actual figure description.think=Falseto both calls.thinkparameter ongenerate()needs ollama-python>=0.5.1; bumped the pinned lower bound from>=0.5.0accordingly.Test plan