Commit Graph

303 Commits

Author SHA1 Message Date
octo-patch a07841e91b fix: handle string attributes in graph ontology to prevent TypeError crash (fixes #135)
When the LLM returns ontology attributes as plain strings instead of
dicts, set_ontology() crashes with "TypeError: string indices must be
integers, not 'str'" at attr_def["name"].

Two-layer fix:
1. ontology_generator.py: normalize string attrs to {"name", "type",
   "description"} dicts during validation, so downstream code always
   receives well-formed structures.
2. graph_builder.py: add isinstance guard as a safety net in
   set_ontology() for both entity and edge attribute loops.

Co-Authored-By: Octopus <liyuan851277048@icloud.com>
2026-07-22 19:51:19 +08:00
BaiFu 4064b68abf
Merge pull request #737: normalize generated profile fields
Establish one canonical profile boundary before Twitter and Reddit serialization.
2026-07-22 19:51:02 +08:00
666ghj c415387995 style: remove trailing whitespace from profile model 2026-07-22 19:50:18 +08:00
666ghj 9f80ad66fd fix: normalize profile fields at construction 2026-07-22 19:49:33 +08:00
ygh1254 41fc932b62 fix: normalize structured LLM profile fields before serialization 2026-07-22 19:49:33 +08:00
BaiFu 666a188f6b
Merge pull request #736: handle GPT-5 parameters deterministically
Use explicit GPT-5 Chat Completions parameters while preserving legacy requests and provider errors.
2026-07-22 19:49:18 +08:00
666ghj e67a52e80f fix: keep GPT-5 compatibility handling narrow 2026-07-22 19:48:32 +08:00
IagoMelo01 f7138e09fb Correction GPT-5 family error 500 2026-07-22 19:48:32 +08:00
BaiFu 2576c06f95
Merge pull request #735: stop Step 2 after preparation failure
Propagate terminal preparation failure and stop all Step 2 polling without fabricating Zep entity labels.
2026-07-22 19:48:14 +08:00
666ghj 05bea4a330 fix: stop Step2 polling after preparation failure 2026-07-22 19:47:20 +08:00
BaiFu 7970d74a86
Merge pull request #734: sanitize fabricated tool results
Remove fabricated tool results consistently before assistant content enters trusted history.
2026-07-22 19:47:02 +08:00
666ghj f0e379471a fix: sanitize fabricated tool results everywhere 2026-07-22 19:46:23 +08:00
MiroFish Contributor 1d96b09875 fix: strip fabricated tool_result blocks to prevent LLM hallucination
When the LLM generates a <tool_call> block followed by a self-generated
<tool_result> block in the same response, the fake result must be stripped
before appending to message history. The real tool result will be injected
separately by the system.

This fixes a React Hallucination bug where models could fabricate tool
results that didn't actually come from tool invocations.
2026-07-22 19:46:23 +08:00
BaiFu ca845b0fcd
Merge pull request #733: support Twitter-only simulation retrieval
Select the configured platform and load Twitter profiles from their actual CSV output.
2026-07-22 19:46:08 +08:00
666ghj b651883d66 fix: load Twitter profiles from CSV 2026-07-22 19:45:30 +08:00
karesansui aaf3ea0a09 Fix silent data loss when platform defaults to reddit for Twitter-only simulations
The API retrieval layer hardcoded reddit as the default platform in 11+ locations. When a Twitter-only simulation was run, all data retrieval APIs silently returned empty results because they looked for reddit_simulation.db which did not exist. This commit reads the simulation enable_twitter/enable_reddit config to determine the correct default platform.

Fixes #150
2026-07-22 19:45:30 +08:00
BaiFu e16456575e
Merge pull request #732: prioritize terminal simulation failure
Stop polling on explicit runner failure even when platform counters could imply completion.
2026-07-22 19:45:17 +08:00
666ghj 8b414607c7 fix: prioritize failed simulation status 2026-07-22 19:44:42 +08:00
cuixiao 867b54cb81 fix: stop polling when simulation fails
Previously, the frontend only checked for 'completed' and 'stopped'
status to stop polling. When the simulation process exited with an
error (runner_status === 'failed'), polling continued indefinitely.

This commit adds handling for the 'failed' status:
- Stop polling when runner_status is 'failed'
- Display error message in the log
- Update UI status to 'error'
- Add i18n translations for simFailed key
2026-07-22 19:44:42 +08:00
BaiFu 66f2bb6e70
Merge pull request #731: add guarded ARM64 Docker publishing
Build amd64 and arm64 images while making manual publication explicit and default-branch-only.
2026-07-22 19:44:11 +08:00
666ghj 898f3b5bea ci: make manual Docker publishing opt-in 2026-07-22 19:43:35 +08:00
Sami Rusani 564a5603d5 ci: build docker image for arm64 2026-07-22 19:43:35 +08:00
BaiFu ce616b05f1
Merge pull request #730: cap Zep edge pagination safely
Add a bounded edge paginator while preserving the existing positional retry API.
2026-07-22 19:43:11 +08:00
666ghj 7d6f6bb135 fix: preserve edge paging call compatibility 2026-07-22 19:42:00 +08:00
harshitanand e58d4f1cc5 fix: add max_items limit to fetch_all_edges to prevent unbounded memory growth (#513)
fetch_all_nodes already had a max_items guard (default 2000) but
fetch_all_edges had no such safeguard, allowing unbounded memory growth
on graphs with large numbers of edges.

Add _MAX_EDGES = 5000 constant and mirror the same loop-guard pattern
from fetch_all_nodes: cap the result list, emit a warning log, and
break pagination once the limit is reached.
2026-07-22 19:42:00 +08:00
BaiFu 53af276f4e
Merge pull request #584: sample long ontology input across the document
Replace first-50000-character truncation with deterministic sampling under the same context budget.
2026-07-22 19:40:54 +08:00
BaiFu ad12d412ee
Merge pull request #598: preserve repeated user messages in chat history
Remove only the current trailing message instead of filtering every earlier message with equal content.
2026-07-22 19:40:49 +08:00
BaiFu fbdae298d0
Merge pull request #720: keep history date and time in the same local timezone
Derive both displayed values from local date components so the card cannot show mismatched days.
2026-07-22 19:40:44 +08:00
BaiFu 231ec22bea
Merge pull request #445: disable Flask debug mode by default
Default Flask debug mode to false while preserving explicit opt-in through FLASK_DEBUG.
2026-07-22 19:40:39 +08:00
BaiFu cbfd03db69
Merge pull request #727: upgrade NLTK to 3.10.0
Upgrade the transitive Python dependency NLTK from 3.9.2 to 3.10.0 to address CVE-2025-14009. The contributor title said 3.9.3, but the reviewed lockfile resolves 3.10.0.
2026-07-22 19:40:34 +08:00
BaiFu 086f1fb5e8
Merge pull request #305: fix graph tasks endpoint crash
Remove the redundant to_dict call because TaskManager.list_tasks already returns dictionaries.
2026-07-22 19:39:57 +08:00
orbisai0security fe2fd5b164 fix: CVE-2025-14009 security vulnerability
Automated dependency upgrade by OrbisAI Security
2026-07-21 09:08:09 +00:00
666ghj 4ebb2ed6e9 feat: localize star history 2026-07-21 15:46:53 +08:00
Osamaali313 e6a502121b fix(frontend): show local date in history cards (not UTC)
HistoryDatabase.vue formatDate() derived the day from UTC
(new Date(dateStr).toISOString().slice(0, 10)) while the sibling
formatTime() uses local hours/minutes. The backend sends naive-local
timestamps (datetime.now().isoformat()), so for any non-UTC client the
two disagree by up to a day -- e.g. for the project's UTC+8 audience a
record created 00:00-08:00 local shows the previous day's date next to
the current time. Derive the date from local components so it matches
the time shown.
2026-07-09 23:27:46 +03:00
BaiFu 96096ea0ff
Merge pull request #640 from lllopic/fix/add-type-hints-and-helper-method
refactor: add type hints and FileParser.is_supported() helper
2026-05-25 00:48:57 +08:00
666ghj 3f4d56116c fix(backend): constrain Python version to 3.11-3.12 2026-05-24 22:59:36 +08:00
BaiFu db1bc144ff
Merge pull request #641 from YunyueLi/docs/readme-polish
docs(readme): fix typo in Shanda logo alt text
2026-05-24 02:02:46 +08:00
YunyueLi faa151131c docs(readme): fix typo in Shanda logo alt text
The Shanda sponsor logo's alt text was `666ghj%2MiroFish | Shanda`,
missing the `F` from the URL-encoded `/`. Every other badge in both
READMEs uses the correct `666ghj%2FMiroFish`. Bring this one in line
with the rest.
2026-05-23 16:30:55 +08:00
lllopic daec4b6be4 refactor: add type hints and FileParser.is_supported() helper
- Add return type annotation (list[str]) to Config.validate()
- Add type annotations (msg: str, -> None) to logger convenience functions
- Add FileParser.is_supported() classmethod for checking file format support
2026-05-23 14:57:46 +08:00
au-sf 442d5fd6cf
fix: don't drop earlier user messages with same content from chat history
The filter was meant to skip the message just pushed by the caller, but
it matches by content, so a repeated message like "tell me more" also
removes the previous turn from the history sent to the backend.
2026-05-02 05:58:58 +00:00
Sami Rusani f0e936ae43 fix: sample long text for ontology generation 2026-04-26 23:01:02 +02:00
ChinhLee e9cac5f8ee fix(security): flask debug mode enabled by default, exposed on 0.0.0.0
DEBUG defaults to True (FLASK_DEBUG env var is 'True' unless overridden) and the server binds to 0.0.0.0. When debug mode is active, Flask enables the Werkzeug interactive debugger, which allows arbitrary Python code execution via the browser-accessible debugger console if an exception is triggered. Combined with the public bind address this creates a remote code execution vector on any deployment that forgets to set FLASK_DEBUG=False.

Affected files: config.py

Signed-off-by: ChinhLee <76194645+chinhkrb113@users.noreply.github.com>
2026-04-02 21:20:56 +07:00
666ghj fa0f6519b1 docs: rename README-EN.md to README.md as default English documentation 2026-04-02 16:52:29 +08:00
666ghj 0e9420e0f8 docs: rename README.md to README-ZH.md for Chinese documentation 2026-04-02 16:52:29 +08:00
BaiFu 7d07fb7f03
Merge pull request #440 from Ghostubborn/fix/security-deps
fix(security): 修复前端 3 个高危依赖漏洞
2026-04-02 15:17:46 +08:00
ghostubborn 223b283da7 fix(security): upgrade axios, rollup, picomatch to fix 3 high severity vulnerabilities 2026-04-02 15:00:33 +08:00
BaiFu af71244974
Merge pull request #428 from Ghostubborn/feat/i18n
feat(i18n): 添加多语言切换功能,支持中英文
2026-04-02 14:27:04 +08:00
ghostubborn ed465908db fix(i18n): set HTML lang attribute before Vue mounts via inline script 2026-04-02 14:21:09 +08:00
ghostubborn 65df257e19 chore(deps): upgrade vue-i18n from v9 to v11 2026-04-02 14:20:50 +08:00
ghostubborn f2404903d6 fix(i18n): validate Accept-Language header against registered locales 2026-04-02 14:20:15 +08:00