Commit Graph

319 Commits

Author SHA1 Message Date
MrBeanDev 5da9cc3d76 fix(simulation): stop discarding an existing run when Step 3 remounts
Step3Simulation mounted with a simulation id and immediately called
doStartSimulation() with force: true. Because the id lives in the route
path (/simulation/:simulationId/start), a browser refresh remounted the
component and re-sent that request, so the backend stopped the running
subprocess and cleaned the run directory: run_state.json, the twitter and
reddit actions.jsonl action logs, and both *_simulation.db files. The
timeline, posts and comments views read those files directly, so the data
was unrecoverable.

Probe the run status before deciding what to do. A simulation that has
never run (runner_status "idle" with no recorded actions) still starts
exactly as before. Anything else is adopted instead of restarted: live
runs resume polling, finished runs load their existing timeline read-only.
If the status probe itself fails we now do nothing rather than risk
overwriting a run we could not verify.

force is also no longer hardcoded to true. The remaining call site only
runs when there is nothing to lose, and the flag should never be an
implicit default.
2026-08-04 07:03:40 +05:30
github-actions[bot] b5b53acc57
chore: update Star History (#755)
Automated aggregate Star History refresh. Recorded 69,857 stars.
2026-08-03 18:19:13 +08:00
BaiFu 0f67b29c6c
fix: submit Star History updates as pull requests (#754)
The workflow now creates and verifies a pull request for manual owner merge without attempting to update main itself.
2026-08-03 18:12:17 +08:00
BaiFu a97ba4ffc9
Fix automated Star History updates on protected main (#752)
Replace direct pushes with a validated temporary-branch and pull-request publication flow.
2026-08-03 14:24:45 +08:00
BaiFu 60757b3c82
Merge pull request #742 from 666ghj/codex/fix-ontology-provider-compatibility
fix: harden ontology JSON generation across LLM providers
2026-07-23 12:47:16 +08:00
666ghj f0d487f310 fix: harden ontology JSON generation 2026-07-23 02:08:17 +08:00
BaiFu d64175943e
Merge pull request #740 from 666ghj/codex/zep-cloud-comprehensive-audit
fix: modernize Zep Cloud integration and dependency security
2026-07-23 00:44:26 +08:00
666ghj 407c391f35 fix: keep Zep timeouts internal 2026-07-23 00:32:53 +08:00
666ghj c81d628975 chore: update vulnerable npm dependencies 2026-07-23 00:26:51 +08:00
666ghj 54bd7a3d4e fix: validate complete Zep entity context 2026-07-23 00:20:50 +08:00
666ghj e4aa38dff2 fix: modernize Zep Cloud integration 2026-07-23 00:20:28 +08:00
BaiFu dd7a646d6b
Merge pull request #739: use the supported Zep node-edge method
Call graph.node.get_edges so entity enrichment no longer retries an absent SDK method and returns empty edges.
2026-07-22 20:08:45 +08:00
666ghj 0d8c23a3c2 fix: use the supported Zep node-edge method 2026-07-22 20:08:18 +08:00
BaiFu aa6abf3e39
Merge pull request #738: normalize ontology fields for Zep
Normalize untrusted LLM ontology fields and enforce the pinned Zep schema limits before upload.
2026-07-22 19:54:36 +08:00
666ghj d2f9e56eea fix: enforce Zep ontology contract limits 2026-07-22 19:53:59 +08:00
666ghj 9506e6f5e0 fix: normalize ontology attributes centrally 2026-07-22 19:51:41 +08:00
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