Skip to content

fix: sample long text for ontology generation - #584

Merged
666ghj merged 1 commit into
666ghj:mainfrom
samrusani:fix-ontology-long-text-chunking
Jul 22, 2026
Merged

fix: sample long text for ontology generation#584
666ghj merged 1 commit into
666ghj:mainfrom
samrusani:fix-ontology-long-text-chunking

Conversation

@samrusani

Copy link
Copy Markdown

Summary

  • replace first-50k ontology truncation with deterministic chunk sampling across long documents
  • keep short-document behavior unchanged
  • add regression tests for short, long, and very long ontology context building

Fixes #582

Test plan

  • uv run pytest -q

@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels Apr 26, 2026
@samrusani

Copy link
Copy Markdown
Author

Just checking whether this is still useful for MiroFish. I'm happy to adjust the sampling approach or tests if you'd prefer a different direction.

@666ghj
666ghj merged commit 53af276 into 666ghj:main Jul 22, 2026
@666ghj

666ghj commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Thank you for following up. This remains useful for MiroFish. We accepted the product tradeoff of deterministic, lossy sampling within the existing 50,000-character budget: it improves coverage across the beginning, middle, and end without claiming full-document processing. The regression tests and current-main integration passed, and the patch has now been merged.

A known limitation is that global sampling can still omit a small document among much larger documents; that can be improved separately if users need a per-document minimum guarantee.

🤖 Sent by the MiroFish repository maintenance agent.

brovzar-lab pushed a commit to brovzar-lab/MiroFish-Lemon that referenced this pull request Jul 28, 2026
Brings in: Zep memory cap for long runs (OOM fix, PR 666ghj#730), zep-cloud 3.25
modernization + barrier tests (666ghj#738-740), profile normalization (666ghj#737),
honest FAILED states (666ghj#732/666ghj#735), fabricated tool_result stripping (666ghj#734),
ontology JSON hardening + long-text sampling (666ghj#742/666ghj#584), GPT-5 param
compat (666ghj#736), Twitter-only data fix (666ghj#733), security fixes (666ghj#445/666ghj#727).

Conflict resolutions:
- llm_client.py: upstream compat-layer base + Lemon CreditExhaustedException
  (402 -> pause/Resume) re-added in _create_completion
- api/report.py: upstream barrier/lifecycle base + Lemon failed-report
  resume (reuse report_id), project-language locale for report thread,
  title-based download filename, 404 on empty download
- report_agent.py: upstream cleaned_response/tool_result stripping kept;
  Lemon language-instruction injection + partial-report salvage intact
- Step3Simulation.vue: upstream authoritative runner_status (drops Lemon
  platformsCompleted shortcut, superseded by the Zep ingestion barrier)

139 backend tests pass; vite build clean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] 支持超长文本的自动分块处理

2 participants