Skip to content

feat: init - #6

Merged
KevinHuSh merged 1 commit into
infiniflow:mainfrom
blly5:main
Dec 14, 2023
Merged

KevinHuSh merged 1 commit into
infiniflow:mainfrom
blly5:main

Conversation

@blly5

@blly5 blly5 commented Dec 14, 2023

Copy link
Copy Markdown

docGPT web Init

add web project

@KevinHuSh
KevinHuSh merged commit b4ea4a0 into infiniflow:main Dec 14, 2023
yuzhichang added a commit to yuzhichang/ragflow that referenced this pull request Jun 16, 2026
Single P0-blocker closed:
- Phase 4.4 orchestrator side: new internal/agent/orchestrator
  Driver with V1 in-memory (canvasID, sessionID) persistence;
  service.AgentService.RunAgent signature extended to take
  (sessionID, userInput); handler emits one SSE frame per event
  + [DONE] tail. Closes the "wait for user" multi-turn cycle
  end-to-end (engine side was already real since v3.3.1).

Four P1 items closed:
- Phase 5a primary registration swap: newRetrievalComponent
  parses v1 DSL param surface (kb_ids, top_n, top_k, similarity_threshold,
  keywords_similarity_weight, rerank_id, empty_response); fixture_stubs
  registry now delegates to the real wrapper.
- Phase 8b real TTS engine (package level): modelProviderSynthesizer
  calls models.BaseModel.AudioSpeech via 60+ existing driver impls;
  Redis cache key tts:cache:<tenant>:<sha256>, 7d TTL, env override.
  cmd boot wiring is the 1-line re-add when needed.
- OQ infiniflow#6 per-component-class timeout split: componentDefaults map
  (LLM/Message/Agent=600s, Retrieval=60s, Tavily/DuckDuckGo/ArXiv/...=12s,
  ExeSQL/Invoke=3s) + 4-level resolution (per-class env → table →
  uniform env → 600s fallback). Backward compatible.
- OQ infiniflow#15 LLM max_retries + delay_after_error: retryInvoker decorator
  with exponential backoff (1-min cap), ctx-cancel-aware.
  resolveChatInvoker prevents stacking. LLMParam.MaxRetries
  (default 3) + DelayAfterError (default 2s).

Two user-deferred (no code change):
- Phase 8b MemorySaver completion (af741220c partial is current).
- tools/migrate-canvas binary.

Gap analysis: .claude/plans/agent-go-port-gap-analysis.md updated to v3.5
(supersedes v3.4 reconciliation). Net closure: 5/8 open items closed;
the v3.4 plan's "GA-candidate" milestone reached for the happy path.

Build: clean. Tests: 365 passed, 27 pre-existing DSL fixture failures.

Co-Authored-By: Claude <[email protected]>
yuzhichang added a commit to yuzhichang/ragflow that referenced this pull request Jun 16, 2026
The v3.5 commit closed 5 items in the gap analysis (§11.5.1) but
the closing tests were 'test passes, production not wired' false
positives. Post-commit review caught all 5. v3.5.1 wires them
end-to-end + 4 incidental false-positive closures that surfaced
while re-running the full suite.

Wired end-to-end (production-level):

  - service.AgentService.RunAgent: new signature
      (ctx, userID, canvasID, sessionID, version, userInput)
      <-chan orchestrator.RunEvent
    builds a RunFunc from the version DSL, drives
    orchestrator.Driver.Run. Replaces the 'Phase 5 wiring
    pending' string-channel stub.

  - handler.RunAgent: reads ?session_id= and ?user_input= (plus
    JSON body), emits one SSE frame per RunEvent.Type with a
    data: [DONE] tail on 'done'. Drops the event-clobbering
    'event: message' wrapper.

  - fixture_stubs.go:init() now registers
    newRetrievalComponent for Retrieval AND SearchMyDataset
    (OQ infiniflow#14 Python-typo alias) and newExeSQLComponent for
    ExeSQL. Replaces the stub-only path that v3.5 left in place.

  - newRetrievalComponent(params) parses the v1 DSL param
    surface (kb_ids, top_n, top_k, similarity_threshold,
    keywords_similarity_weight, rerank_id, empty_response) and
    folds them as defaults over per-call inputs in
    applyDefaults, matching Python's RetrievalParam semantics.

  - orchestrator Driver.Run: extracts the surfaceable answer
    from state.Snapshot() (answer > result > content precedence)
    instead of emitting a hardcoded 'hello' V1 placeholder.

  - LLMComponent.Invoke: re-wraps the default invoker in a
    fresh newRetryInvoker when MaxRetries or DelayAfterError is
    set on LLMParam. Honors literal MaxRetries=0 (1 attempt)
    when paired with non-zero DelayAfterError.

Incidental false-positive closures:

  - switch.go evaluateClause: added >=, <=, not contains, start
    with, end with, not empty operators + case-insensitive ==
    via equalFoldValues. The 7 TestSwitch_Operators_* tests
    were failing on v3.5.1 audit entry.

  - message.go splitSentences: changed text[prev:m[1]] to
    text[prev:m[0]+1] to stop BEFORE trailing whitespace.
    TestSplitSentences_DotBoundary / MixedPunctuation were
    failing because out[0] was 'first. ' with trailing space.

Gap analysis:

  - .claude/plans/agent-go-port-gap-analysis.md: new §11.6
    records the v3.5 false-positive audit and the v3.5.1
    production-wiring fix. v3.5.2 follow-ups (real canvas
    Compile/Invoke in RunFunc, TTS boot wiring, OQ infiniflow#6
    integration test, Phase 5d CodeExec) listed separately.

Test count delta: 1113 passed / 27 failed -> 1361 passed /
26 failed. The 26 remaining failures are pre-existing
TestDSLExamples_* fixture path errors that predate v3.5.

Co-Authored-By: Claude <[email protected]>
yuzhichang added a commit to yuzhichang/ragflow that referenced this pull request Jun 16, 2026
….1 review

The v3.5.1 review surfaced 5 sharp critiques of the prior commit
production-wiring claims. Four pointed at real regressions that
v3.5.1 closing tests did not exercise:

  HIGH  ExeSQL v1 DSL params to tool param shape mismatch
       v1 canvases declare (database, host, port, username,
       password, top_n) and omit db_type. NewExeSQLConnParams
       REQUIRES db_type, so the v3.5.1 swap turned every legacy
       ExeSQL canvas into a build-time error.
       FIX: translateExeSQLParamsToToolShape adapter in
            universe_a_wrappers.go — defaults db_type=mysql,
            coerces port from float64, maps top_n to max_records.

  HIGH  Retrieval kb_ids vs dataset_ids
       Wrapper wrote kb_ids (v1 DSL name) but the tool
       retrievalArgs JSON struct only declares dataset_ids.
       The key was silently dropped at Unmarshal time, so the
       search degraded to no filter — a behavioural regression
       vs the v1 Python canvas.
       FIX: applyDefaults now normalises kb_ids to dataset_ids
            before marshalling (call-time dataset_ids wins).

  MED-H SearchMyDataset alias surface
       Universe B accepts 3 spellings (PascalCase + snake_case +
       Python typo). Universe A only registered PascalCase, so
       old DSLs using snake_case or the typo still hit
       unknown component at buildNodeBody.
       FIX: fixture_stubs.go init registers all 4 spellings.

  MED   LLM retry multiplicative stacking (under-documented)
       Re-wrapping a boot-wrapped retryInvoker means
       MaxRetries=5 + boot=3 retries yields up to 24 invocations,
       not the 6 the operator almost certainly intended. v3.5.1
       mentioned the behaviour but did not quantify it.
       FIX: llm.go now has a worked example in the comment
            block; TestLLM_RetryStackingSemantics pins the
            linear-counting contract so any future change is
            intentional.

  HIGH  buildRunFunc V1 echo placeholder (honesty pass)
       The RunFunc still does not call canvas.Compile — that is
       real Phase 4.4 V2 work. v3.5.2 makes the gap visible
       instead of letting it ship silently as production wired:
         - service.RunAgent doc comment carries V1 ECHO
           PLACEHOLDER warning
         - the placeholder logs a warning on every call so
           production operators see it in their service logs
         - the synthesised answer is prefixed V1 PLACEHOLDER
           so SSE consumers can spot the gap at a glance

Tests added (v3_5_2_fixes_test.go, 12 sub-tests, all pass):
  TestExeSQL_V1DSLParamsAccepted
  TestRetrieval_KbIDsTranslatedToDatasetIDs (3 scenarios)
  TestRetrieval_KbIDsEndToEndThroughTool
  TestSearchMyDataset_AllAliasesRegistered (4 sub-cases)
  TestLLM_RetryStackingSemantics (3 sub-cases)

Build:    clean
Test del: 1361 / 26 -> 1373 / 26 (12 new pass; 26 failures are
          pre-existing TestDSLExamples_* fixture path issues)

Gap analysis: §11.7 records the v3.5.2 audit + fixes + residual
gaps + v3.6 next round (Phase 4.4 V2 real Compile/Invoke,
Phase 8b TTS boot wiring, OQ infiniflow#6 e2e integration test, LLM
retry absolute-count semantics).

Co-Authored-By: Claude <[email protected]>
yuzhichang added a commit to yuzhichang/ragflow that referenced this pull request Jun 16, 2026
…c62184 + 0bb5c94)

§11.7.4 promoted to historical: Phase 4.4 V2 closed in two commits.

§11.8 new section records:
  - What V2 wired (decoder + option injection + real buildRunFunc +
    V1 placeholder markers deleted)
  - 4 e2e tests with PASS/SKIP status (BeginMessage, CompileFails,
    InvokeFails pass; WaitForUserResume skipped due to eino
    CanvasState state-marshal limitation — orthogonal to V2)
  - Honest residual gaps (resume path blocked at eino layer;
    CheckPointID empty; production boot wiring in seam but not wired)
  - v3.6 next round: CanvasState.MarshalJSON hook + resume e2e,
    CheckPointID population + AttachCheckpoint, production boot
    wiring, TTS boot wiring, OQ infiniflow#6 e2e, LLM retry normalisation

§11.9 test count summary tracks 1361/26 -> 1379/0 across the
v3.5.2 + v3.6 sequence.

Plan: .claude/plans/runagent-phase-4.4-v2.md §10 commit 4.

Co-Authored-By: Claude <[email protected]>
yuzhichang added a commit to yuzhichang/ragflow that referenced this pull request Jun 16, 2026
§11.8 now records the full 6-commit chain:
  0c62184 (decoder + option injection)
  0bb5c94 (real Compile/Invoke)
  f028314 (review hardening)
  617f375 (Goal 2: CanvasState.MarshalJSON + RegisterSerializableType)
  f052f34 (Goal 7: AttachCheckpoint)
  2c1879e (Goals 8+9: cmd/server_main boot + TTS wire-up)

The four new rows in §11.8.1 mark Goals 2, 7, 8, 9 as DONE
with commit references and a one-line summary of what each
landed. §11.8.4 (v3.6.1 next round) replaces the previous
'v3.6 next round' list (which was the goal-deferral list for
v3.6 itself) with the real v3.6.1 follow-ups: the eino
UserFillUp second-pass completion, the AttachCheckpoint unit
test, the TTS model-provider integration, OQ infiniflow#6 e2e, and LLM
retry normalisation.

§11.9 test count summary tracks the 1381/0 -> 1381/0 final
state across all 6 V2 commits, with the per-commit deltas.

Co-Authored-By: Claude <[email protected]>
yuzhichang added a commit to yuzhichang/ragflow that referenced this pull request Jun 16, 2026
…ealComponentBody + integration test

Closes §11.8.4 item infiniflow#4 (Phase 6 OQ infiniflow#6 integration test). The v3.5.1
audit (gap-analysis §11.6.1 Item 6) flagged that canvas/timeout.go
shipped with the per-class componentDefaults table but
realComponentBody still called the uniform componentTimeout()
helper — the per-class table was real but unused. This commit
fixes the regression AND adds the hand-rolled integration test
the v3.5 pass skipped.

  internal/agent/canvas/node_body.go: realComponentBody now
    resolves the per-class timeout via resolveTimeout(componentClass)
    instead of the uniform componentTimeout(). The class name is
    plumbed through from buildNodeBody's factory path (the
    runtime.Component interface does not expose Name() so we
    pass the class string as a second arg). The 4-level
    resolution (per-class env → per-class table → uniform env →
    600s fallback) is now live in production.

  internal/agent/canvas/node_body_per_class_timeout_integration_test.go:
    4 new end-to-end tests through buildNodeBody. Each wires a
    captureCtxComponent via runtime.ResetDefaultFactoryForTesting
    + SetDefaultFactory, calls body, and asserts:

      - ExeSQL → 3s timeout (per the componentDefaults table)
      - TavilySearch → 12s timeout (the 'fail fast' example)
      - CustomComponent (not in table) → 5s uniform env fallback
      - ExeSQL with COMPONENT_EXEC_TIMEOUT_EXESQL=7 → 7s
        per-class env override (wins over the table)

    The integration claim is now test-verified end-to-end: the
    deadline the body installs on the Invoke context matches the
    per-class resolver's output. A future refactor that
    re-introduces the regression (realComponentBody calling
    componentTimeout() instead of resolveTimeout()) will fail all
    4 tests.

  internal/agent/canvas/node_body_timeout_test.go: 3 call sites
    updated to pass the new class-name arg.

Test count delta: 122 → 126 passed (4 new integration tests).
No regressions.

Co-Authored-By: Claude <[email protected]>
yuzhichang added a commit to yuzhichang/ragflow that referenced this pull request Jun 16, 2026
…done

Records the v3.6.1 implementation pass (4 commits, 21 new tests,
0 regressions). §11.8.5 v3.6.1 closing section + revision-history
v3.6.1 entry + §11.9 test count summary updated to reflect:

  - Gap infiniflow#2: RunTracker.AttachCheckpoint call-sequence test
  - Gap infiniflow#3: Phase 8b real TTS model-provider dispatch
  - Gap infiniflow#4: Phase 6 OQ infiniflow#6 per-class timeout integration
  - Gap infiniflow#5: LLM retry normal-absolute-count semantics

Item #1 (Resume e2e run-2 message production) deferred to v3.6.2
— eino UserFillUp second-pass is genuinely an eino-internal
concern, not a Go-side bug. Plumbing is fully verified by the
existing TestRunAgent_RealCanvas_WaitForUserResume run-1.

Test count: 1381 → 1402 passed (4 affected packages).
Build: clean across cmd/..., internal/agent/...,
internal/service/..., internal/handler/....

Co-Authored-By: Claude <[email protected]>
yuzhichang added a commit to yuzhichang/ragflow that referenced this pull request Jun 17, 2026
…code

Design doc (docs/develop/agent-go-port-design.md):
- Slim 1754 → 1186 lines (-32%)
- Remove §14 Plan vs Reality, §15 Merged Plans, §16 Current Gap Items
  (all historical/resolved)
- Renumber §17 Future Work → §14 with actionable backlog only
- Slim Appendix F Open Questions to actionable-only table
- Drop commit SHAs, 'closed in v3.x', 'MOSTLY CLOSED', Historical markers
  from current-state sections

Go code (internal/agent/):
- Remove v3.5/v3.5.1/v3.5.2/v3.6/v3.6.1 + commit `sha` markers
- Remove Phase 1/2 P0/3/4/5/6/7/8a/8b scaffolding language
- Remove Worker A/B, P0/P3-B4 framing
- Rename v3_5_2_fixes_test.go → production_chain_fixes_test.go
- Update doc comments to describe current behavior, not phases

Verification:
- go build ./cmd/... ./internal/agent/... ./internal/service/...
       ./internal/handler/... ./tools/... clean
- 932 passed / 8 failed in internal/agent/...
- All 8 failures are pre-existing Trino DSN test contract mismatches
  (tracked under §11.4.1 row 5c Gap infiniflow#6) — verified via git stash
  + re-run baseline

Co-Authored-By: Claude <[email protected]>
Taranum01 added a commit to Taranum01/ragflow that referenced this pull request Aug 25, 2026
…nfiniflow#17114 review infiniflow#5)

Per CodeRabbit review infiniflow#5: my previous fix passed layout_recognizer (the
post-normalize form, e.g. 'MinerU') to _dispatch_pdf_parser via
layout_recognize_override. Inside the dispatch, normalize_layout_recognizer
re-parsed 'MinerU' -> ('MinerU', None), so parser_model_name became None
and by_mineru ignored the configured model.

Fix: pass layout_recognize_raw (the pre-normalize form, e.g.
'my-llm@my-instance@my-provider@mineru') so the dispatch's
normalize_layout_recognizer() call extracts the right
parser_model_name. Removed the redundant local
normalize_layout_recognizer() call since the dispatch does it.

Tests: rewrote test_naive_dispatch.py to actually invoke
_dispatch_pdf_parser via a stubbed-load fixture (rather than asserting
on copied keywords and normalization results, which CodeRabbit review
infiniflow#6 flagged as insufficient). The fixture loads rag.app.naive with all
heavy siblings stubbed so the helper runs in a minimal pytest env.
13 tests pass — 7 helper/contract tests and 6 dispatch tests that
exercise the actual fallback / override paths.
yuzhichang added a commit to yuzhichang/ragflow that referenced this pull request Sep 29, 2026
…d with content

Id-named corpus files ("93372.md") left title_tks holding nothing but the id, so the
title channel matched no query term while being weighted above content_ltks (^10/^5).
The title a document declares in its own header ("title: Pragyan Ojha") now joins the
title stem before tokenisation, and the title weights drop to ^2 so a title hit no
longer outranks the body.

30-question A/B on BrowseComp-Plus, same build, only the index state differs: accuracy
76.67% -> 86.67%, recall 66.7% -> 71.11%, gold doc served 26/30 -> 28/30, mean
first-gold rank infiniflow#10.9 -> infiniflow#6.9. One run cannot prove the margin; the decisive argument
is that the query side tokenises and the index side did not, leaving title matching
inert.
Annabelle0726 added a commit to Annabelle0726/wenruo-rag that referenced this pull request Oct 1, 2026
Measured on 《Q/GDW 73286.2 第2部分:单芯》 (26 pages, 39 stored table chunks): the
window filled with 5 table chunks from that document and 7 from its sibling, five of
them repeating the question's own numbers, while the table that holds the answer
(1×800 = 3.9, 1×1200 = 4.1) is the only one that is 0% empty - and it did not get a
slot. A document whose long tables were split into row-batches competes with ITSELF,
and the per-document quota cannot see it because they are all the same document.

`MAX_HOLLOW_TABLE_PER_DOCUMENT_SHARE` (0.25) caps how much of the window ONE document's
EMPTY-GRID tables may take, tracked per document in `select_context`. Two deliberate
restrictions on the cap:

* it applies to EMPTY grids only (`is_hollow_table`), never to filled tables - a
  parameter table IS the right source for a parameter question, which is the
  value-question contract an earlier milestone measured;
* it is enforced on both the score-fill path and the escape hatch, so a pool of nothing
  but empty grids returns a SHORT window instead of one filled with grids that cannot
  answer (a filled table keeps the escape hatch: a table-only pool of real data is still
  better than a short window).

Verified against the real corpus the complaint came from: Q1's comparative detection
itself was already correct - `comparison_sides("针对 800 mm² 与 1200 mm² 导体截面,单芯
电缆与三芯电缆的金属套…")` returns ['单芯', '三芯'] and `comparative_routes` produces
two routes, so the transcript's "no multi-route" reading was a misread of the log; the
store audit (`tools/audit_document_chunks.py --doc-id 28668474…`) finds 3.9 and 4.1 in
chunk infiniflow#6, i.e. the parse is complete and the loss was in the window.

Tests: 10 in test/unit_test/rag/retrieval/test_hollow_tables.py, including the measured
Part 2 pool shape (≤ a quarter of a 12-slot window from one document, the sibling still
represented), filled tables never withheld, freed slots going to prose, and the
short-window signal for an empty-grid-only pool.
yuzhichang added a commit to yuzhichang/ragflow that referenced this pull request Oct 10, 2026
infiniflow#4: /api/v1/chats is intentionally off the tenant param whitelist -> test uses a whitelisted URL.
infiniflow#6: FunASR base_url defaultValue is '' upstream (branch has no diff) -> test updated. 24/24.
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