Skip to content

fix(evolve): recover AI progress across navigation#16

Open
Xnhyacinth wants to merge 6 commits into
mainfrom
fix/evolve-progress-sync-recovery
Open

fix(evolve): recover AI progress across navigation#16
Xnhyacinth wants to merge 6 commits into
mainfrom
fix/evolve-progress-sync-recovery

Conversation

@Xnhyacinth

@Xnhyacinth Xnhyacinth commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR stabilizes the AI/Evolve and Twin flows after the latest main merge. It focuses on restoring backend-backed results, keeping active AI runs visible after navigation, and hardening Twin run recovery/sync behavior.

Feature Additions

  • Add Twin recent run history support so users can see and resume the latest 5 Twin runs from the progress area.
  • Add /api/twin/runs and related run metadata helpers for history rendering and exact run resume.
  • Add run-scoped Twin reads for overview/cards/traits/events/runtime-preview/avatar/sync so the UI can bind to the active run_id instead of mixing data across runs.
  • Add Evolve legacy cache fallback/migration so existing file-cache results for profile, memory, and other tabs can be surfaced and moved into the shared cache path.
  • Add Evolve/Twin frontend regression coverage for streaming recovery, cache recovery, navigation state, and run-scoped reads.
  • Add AI engine health checks and explicit engine fallback behavior to make Codex/Claude selection more predictable.

Bug Fixes

  • Fix #ai profile/memory panels showing empty/no-cache states even when backend or legacy cache results already exist.
  • Fix #ai active Evolve runs being hidden by stale local Timeout/network error cache after switching away and returning.
  • Fix Evolve server-cache reload paths overwriting active running UI while backend progress is still alive.
  • Fix inactive Evolve tab panels being created visible during background preload.
  • Fix server restart process matching by normalizing pid values before inspecting command lines.
  • Fix Twin progress/resume synchronization after tab reloads or disconnected streams, including exact run_id resume.
  • Fix Twin sync safety so CHATVIEW_CLAUDE_MD/test-scoped writes go to the requested target instead of touching the real global ~/.claude/CLAUDE.md.
  • Fix Python 3.9 CI imports by replacing Python 3.10+ union annotations in touched modules with typing.Optional / typing.Union.
  • Merge latest origin/main and resolve conflicts with main behavior as the base, then reapply the Evolve/Twin recovery logic on top.

Validation

  • python3 -m unittest tests.test_api.TestTwinSyncScoping tests.test_api.TestTwinRunScopingReads tests.test_api.TestTwinResumeLatestTrait tests.test_api.TestTwinAvatarScoping tests.test_api.TestTwinResumeCheckpointOnly -> Ran 13 tests ... OK
  • python3 -m py_compile server.py analyze.py db.py chatview/ai_engine.py chatview/cli.py chatview/server.py chatview/handlers/twin.py chatview/utils/sync.py -> exit code 0
  • python3 - <<'PY' ... ast.parse(..., feature_version=(3, 9)) ... PY -> chatview/utils/sync.py: py39 ast ok, chatview/ai_engine.py: py39 ast ok
  • node --check static/evolve.js && node --check static/twin.js -> exit code 0
  • ruff check . -> All checks passed!
  • python3 -m unittest discover -s tests -> Ran 159 tests ... OK (skipped=3)
  • GitHub Actions run 28465262479 -> lint, test (3.9), test (3.11), and test (3.13) passed

Add robust backend progress recovery for Evolve tabs, prevent stale transient errors from masking active runs, and improve Twin run history/status behavior.

Also harden AI engine selection, sync writes, i18n flows, and add regression coverage for streaming, cache recovery, and Twin integrity.

Signed-off-by: xnhyacinth <huanxuanliao@gmail.com>
Signed-off-by: xnhyacinth <huanxuanliao@gmail.com>
Signed-off-by: xnhyacinth <huanxuanliao@gmail.com>
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.

1 participant