Skip to content

fix: harden runtime API and simulation handling#718

Open
CyrusAuyeung wants to merge 2 commits into
666ghj:mainfrom
CyrusAuyeung:agent/fix-runtime-api-zep-simulation
Open

fix: harden runtime API and simulation handling#718
CyrusAuyeung wants to merge 2 commits into
666ghj:mainfrom
CyrusAuyeung:agent/fix-runtime-api-zep-simulation

Conversation

@CyrusAuyeung

@CyrusAuyeung CyrusAuyeung commented Jul 7, 2026

Copy link
Copy Markdown

Summary

Fixes #717.

This PR hardens runtime paths that can break end-to-end runs when using OpenAI-compatible third-party providers and long-running dual-platform simulations:

  • pass configured API key/base URL and provider-safe headers to direct OpenAI SDK clients and CAMEL simulation clients
  • make persisted simulation state reads tolerate UTF-8 BOMs
  • validate real simulation process liveness before accepting interview/deep-interaction IPC commands
  • preserve completed simulation state during shutdown cleanup, with regression coverage
  • advance action cursors after initial seed posts so they are not duplicated into the next round
  • preserve multiple initial posts assigned to the same agent in Twitter paths
  • clean terminal-run logs before a restart while refusing to discard pending graph-memory updates
  • suppress idle and empty action cards while retaining meaningful like/dislike/comment activity
  • restore an existing simulation view instead of force-starting the simulation again on mount
  • return validation-style 400s for malformed JSON request bodies instead of surfacing 500s
  • declare psutil as a direct backend dependency because simulation liveness imports it directly

Rebase notes

Rebased onto main@60757b3c after #742 merged.

The provider configuration, IPC liveness, state handling, initial-post handling, malformed JSON, BOM, and simulation action fixes remain independent changes in this PR.

Related context

Validation

  • uv run python -m pytest -q: 133 passed
  • npm run build: passed
  • git diff --check origin/main...HEAD: passed
  • origin/main verified as an ancestor of the rebased head

The frontend build still emits the existing warning about a large JS chunk and a module that is both statically and dynamically imported. The backend tests pass without failures.

@CyrusAuyeung
CyrusAuyeung marked this pull request as ready for review July 7, 2026 14:48
@666ghj 666ghj added Memory Layer Any questions related to RAG, GraphRAG and LLM Memory. LLM API Any questions regarding the LLM API labels Jul 22, 2026
@666ghj

666ghj commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Note

🤖 Automated maintainer response — Generated by the MiroFish triage agent and checked against main@d641759 on 2026-07-23. Posted with maintainer authorization; a maintainer may revise it.

Reviewed against current main. The Zep 400-character query cap in this PR has now landed through #740 at the shared service boundary with regression tests for both graph search and profile enrichment.

The provider configuration, IPC liveness, completed-state cleanup, initial-post handling, malformed JSON, BOM state, and psutil changes remain separate runtime work and have not been closed by #740. Please rebase and remove the now-duplicated Zep query change; this PR stays open for review of the remaining scope.

@CyrusAuyeung
CyrusAuyeung force-pushed the agent/fix-runtime-api-zep-simulation branch from 2929097 to 690a6a2 Compare July 22, 2026 17:30
@CyrusAuyeung

Copy link
Copy Markdown
Author

Addressed in the force-updated head 690a6a2:

Validation after the rebase: backend 113 passed, frontend production build passed, and git diff --check passed.

@666ghj

666ghj commented Jul 23, 2026

Copy link
Copy Markdown
Owner

Note

🤖 Automated maintainer response — Generated by the MiroFish maintenance agent after reviewing this PR against main@60757b3c on 2026-07-23. Posted with maintainer authorization; a maintainer may revise it.

Current main has advanced again through #742, which resolves the ontology structured-output, truncation, and opaque 500 path referenced in this PR and #717.

The remaining provider request/header handling, IPC liveness, completed-state cleanup, initial-post behavior, malformed request handling, BOM state, and simulation UI changes are independent and remain eligible for review. Please rebase onto main@60757b3c and reconcile any llm_client.py or ontology-error overlap with #742; do not reintroduce the superseded ontology path.

This PR stays open for the remaining runtime scope.

@CyrusAuyeung
CyrusAuyeung force-pushed the agent/fix-runtime-api-zep-simulation branch from 690a6a2 to d426d6b Compare July 23, 2026 05:18
@CyrusAuyeung

Copy link
Copy Markdown
Author

Addressed in the force-updated head d426d6b:

Validation after the rebase: backend 133 passed, frontend production build passed, git diff --check passed, and origin/main is an ancestor of the updated head.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LLM API Any questions regarding the LLM API Memory Layer Any questions related to RAG, GraphRAG and LLM Memory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Runtime failures with OpenAI-compatible providers, Zep search, interviews, and initial posts

2 participants