Today both vibecomfy runtime paths are cold-per-call:
Embedded: vibecomfy/runtime/run.py:125-138 enters/exits a fresh Comfy() context per run. The exit calls embedded_comfy_client.py:_cleanup -> model_management.unload_all_models() + gc + soft_empty_cache. Models are dumped after every generation.
Managed server: vibecomfy/runtime/server.py:16 starts comfyui as a subprocess, queues once, terminates. Same outcome at the process level.
ComfyUI itself already keeps models warm by default — current_loaded_models persists in process, load_models_gpu reuses resident copies, eviction is pressure-driven, OOM is auto-handled (execution.py:735-737), and DISABLE_SMART_MEMORY is the only thing that forces unload after each prompt. So the work is structural: stop tearing the runtime down.
Goal
Add session-aware warm runtime to vibecomfy with two backends sharing one abstraction:
Long-lived managed Comfy server (HTTP control plane) — default for CLI users.
Default policy: keep warm. Explicit flush available. Auto-flush on detected model-set change under VRAM pressure.
Verified facts (don't re-research)
POST /free and POST /api/free both exist in the embedded hiddenswitch fork at comfy/cmd/server.py:1041 with /api mirror auto-added at :1357. Payload: {"unload_models": bool, "free_memory": bool}. They set queue flags via prompt_queue.set_flag(...) — async, take effect at next prompt boundary, not synchronously.
CLI flags exist in comfy/cli_args.py:115-160: --highvram, --lowvram, --normalvram, --reserve-vram , --disable-smart-memory, --cache-classic, --cache-lru N, --cache-none.
Comfy.clear_cache() (embedded_comfy_client.py:385) and Comfy.reconfigure() (:398) already exposed; reconfigure uses MODEL_MANAGEMENT_ARGS fingerprint to avoid unnecessary subprocess cycling.
The cleanup that nukes warm state lives in embedded_comfy_client.py:_cleanup (lines ~149-169) and is called from Comfy.aexit (line ~481).
Design constraints / refinements over the user's notes
Assistant
{"output":"I’ll implement only T1: create the session module, move the shared helpers out of runtime/run.py without adding later auto-flush behavior, and run import/test checks for the affected runtime surface.","files_changed":[],"commands_run":[],"deviations":[],"task_updates":[],"sense_check_acknowledgments":[]}
Assistant
{"output":"I found run.py is still self-contained, so T1 is a straight relocation plus new types. I’m checking the existing runtime tests now so the wrapper preserves the expected HiddenSwitch configuration behavior.","files_changed":[],"commands_run":[],"deviations":[],"task_updates":[],"sense_check_acknowledgments":[]}
Assistant
{"output":"I’m about to edit vibecomfy/runtime/session.py and vibecomfy/runtime/run.py. The key compatibility point is keeping _embedded_configuration(workflow) available from runtime.run while moving the actual implementation into the new session module.","files_changed":[],"commands_run":[],"deviations":[],"task_updates":[],"sense_check_acknowledgments":[]}
Assistant
{"output":"The relocation compiles and the partition spot checks match the flagged precedence rules. I’m running the affected runtime test module and import checks next, which should catch cycles and the existing embedded configuration contract.","files_changed":[[REDACTED],[REDACTED]],"commands_run":["python -m compileall vibecomfy/runtime/session.py vibecomfy/runtime/run.py","python - <<'PY'\nfrom vibecomfy.runtime.session import _partition_comfy_config\ncases = [\n {'port': 8200, 'reserve_vram': 12, 'fp8_e4m3fn_text_enc': True},\n {'reserve_vram_gb': 2.0, 'reserve_vram': 12},\n {'cache_none': True, 'cache_lru': 3, 'cache_policy': 'classic'},\n]\nfor case in cases:\n print(case, '->', _partition_comfy_config(case))\nPY"],"deviations":[],"task_updates":[],"sense_check_acknowledgments":[]}
Assistant
{"output":"The direct Python import check passed, including from vibecomfy.runtime import RunResult. The bare pytest entrypoint here is not adding the repo root to sys.path, so I’m rerunning through python -m pytest, which uses the active interpreter path consistently.","files_changed":[[REDACTED],[REDACTED]],"commands_run":["python -c 'import vibecomfy.runtime.session; import vibecomfy.runtime.run; from vibecomfy.runtime import RunResult; print(RunResult.name)'","pytest tests/test_runtime_run.py"],"deviations":["Bare pytest tests/test_runtime_run.py failed at collection with ModuleNotFoundError for local package vibecomfy; rerunning with python -m pytest from the repo root."],"task_updates":[],"sense_check_acknowledgments":[]}
Assistant
{"output":"tests/test_runtime_run.py passes under python -m pytest. I’m doing the requested broader verification now with the full suite so this batch has a clean regression signal, separate from the bare-pytest path issue.","files_changed":[[REDACTED],[REDACTED]],"commands_run":["python -m pytest tests/test_runtime_run.py"],"deviations":["Bare pytest tests/test_runtime_run.py failed at collection with ModuleNotFoundError for local package vibecomfy; python -m pytest tests/test_runtime_run.py passed."],"task_updates":[],"sense_check_acknowledgments":[]}
Assistant
User
Assistant
{"output":"Batch 2 complete. T2 implemented and verified. passed, and the full suite passed with 87 passed, 1 skipped. Checkpoint written to .","files_changed":["vibecomfy/runtime/session.py",".megaplan/plans/vibecomfy-warm-runtime-20260425-1936/execution_batch_2.json"],"commands_run":["python - <<'PY' ... FakeComfy auto-flush gate trace covering auto/never/always ... PY","python - <<'PY'\nfrom vibecomfy.runtime.session import _free_vram_gb\nvalue = _free_vram_gb()\nprint(value)\nassert value == float('inf')\nPY","python -m compileall vibecomfy/runtime/session.py","python -m pytest tests/test_runtime_run.py","python -m pytest"],"deviations":[],"task_updates":[{"task_id":"T2","status":"done","executor_notes":"Added the EmbeddedSession.run auto-flush gate. It computes model_fingerprint(api_dict), resolves VIBECOMFY_WARM over SessionConfig.warm_policy, flushes before queueing for policy never, suppresses auto-flush for always, and in auto flushes only when last_fingerprint exists, the fingerprint changed, and _free_vram_gb() is below the configured threshold. last_fingerprint is updated only after queue_prompt_api succeeds. Added _free_vram_gb() with lazy comfy.model_management import and float('inf') fallback on ImportError/AttributeError. Verified with a FakeComfy trace for same fingerprint + low VRAM, changed fingerprint + low VRAM, changed fingerprint + high VRAM, same loader + different seed, VIBECOMFY_WARM=never, and VIBECOMFY_WARM=always. Independently confirmed _free_vram_gb() returns inf when comfy.model_management is unavailable. python -m pytest tests/test_runtime_run.py and full python -m pytest passed.","files_changed":["vibecomfy/runtime/session.py"],"commands_run":["python - <<'PY' ... FakeComfy auto-flush gate trace covering auto/never/always ... PY","python - <<'PY'\nfrom vibecomfy.runtime.session import _free_vram_gb\nvalue = _free_vram_gb()\nprint(value)\nassert value == float('inf')\nPY","python -m compileall vibecomfy/runtime/session.py","python -m pytest tests/test_runtime_run.py","python -m pytest"],"auto_attributed_files":true}],"sense_check_acknowledgments":[{"sense_check_id":"SC3","executor_note":"Confirmed the auto-flush gate honors VIBECOMFY_WARM: never flushes before every run, always never auto-flushes, and auto flushes only on model-fingerprint change under low VRAM. Confirmed _free_vram_gb returns float('inf') when comfy.model_management is unavailable."}]}
User
Do NOT default to --highvram (breaks multi-model workflows that need offload). Default to Comfy's smart memory.
/free is asynchronous — flush API must either drain via a no-op prompt or document the queue-flag semantics. Tests must account for this.
Auto-flush should only trigger on model-set fingerprint change AND VRAM-headroom-below-threshold. Input/seed/prompt changes must NOT trigger flush.
Session lifecycle: daemon-style for CLI (pidfile + URL file under out/sessions//) so multiple vibecomfy run invocations share one warm pool. Embedded session is just a Python context manager.
Browser-only tasks: there are none in this plan (no UI work).
No hard-halt prereq clauses: each milestone is independently shippable.
Out of scope for this megaplan
Multi-GPU session pooling.
Distributed/remote session sharing across machines.
Workflow-graph-level caching (Comfy already has --cache-lru / --cache-classic).
Replacing the existing one-shot run/run_embedded APIs — they should remain as thin wrappers around the new session.
Cloud/RunPod orchestration changes (the runpod worker can adopt EmbeddedSession in a separate plan).
Suggested milestone shape (megaplan can refine during prep/plan)
M1: Session abstraction + embedded backend
vibecomfy/runtime/session.py: VibeSession protocol + EmbeddedSession holding a long-lived Comfy() across multiple .run(workflow) calls.
Refactor run_embedded() to be a one-shot wrapper around EmbeddedSession.
Tests: two sequential runs in one session reuse models (assert via inspecting comfy.model_management.current_loaded_models after each run, or via a stub model manager); flush() drops them; reconfigure with same fingerprint is a no-op.
M2: Managed server backend
ServerSession: keeps comfy_server subprocess alive across .run() calls. Start = spawn + wait-ready. .flush() = POST /api/free with appropriate flags. .stop() = SIGTERM with timeout fallback to SIGKILL.
vibecomfy run auto-discovers active session if one exists, else falls back to one-shot managed mode.
Tests: session start/stop, flush via HTTP, two runs share warmth, daemon survives across CLI invocations.
M3: Auto-flush policy + fingerprinting
vibecomfy/runtime/model_fingerprint.py: extract loader-node identity tuples from a workflow (CheckpointLoaderSimple.ckpt_name, LoraLoader.lora_name, UNETLoader.unet_name, VAELoader.vae_name, CLIPLoader.clip_name, DualCLIPLoader, etc. — discover the canonical set from the embedded fork's nodes).
Session.run() compares current workflow fingerprint to last-run fingerprint. If different AND free VRAM < threshold (configurable, default e.g. 2GB), call flush() before queueing.
VIBECOMFY_WARM env var: auto (default) | always | never.
Tests: same model + different seed -> no flush; different ckpt -> flush; auto-flush gated by VRAM headroom (mock get_free_memory).
Smoke test: vibecomfy session start && vibecomfy run x.json && vibecomfy run y.json && vibecomfy session stop — second run is materially faster than first (timing-based, with tolerance).
Open questions for the planning step
Should vibecomfy run lazily start a session on first call and reuse it (implicit warm) vs always require session start? Lean toward explicit start for predictability.
Does the runpod worker (reigh-workspace/reigh-worker) want to consume EmbeddedSession directly or talk to a local managed session? Probably embedded — it owns the process lifecycle already. Out of scope for this plan, but the API should not preclude it.
Do we need partial flush (just CLIP, just VAE, just UNet)? Probably no — Comfy's pressure-driven eviction handles per-model decisions; only expose all-or-nothing flush at the session boundary.
Success criteria (suggested — planning phase should refine)
A VibeSession abstraction exists with both Embedded and Server backends.
Two sequential .run() calls in one session share warm models (verified by test, not just timing).
flush() is explicit and works for both backends. For the server backend, the test accounts for /free's queue-flag semantics.
vibecomfy session start/stop/list/flush CLI commands exist and survive across separate vibecomfy invocations.
Auto-flush policy fires on model-set change under VRAM pressure, never on seed/input changes.
Existing run and run_embedded one-shot APIs continue to work unchanged (backwards compatibility).
Documentation updated in docs/runtime_lifecycle.md and docs/runtime_surface.md.
User notes and answers:
FLAG-012 fix: _partition_comfy_config must accept both typed SessionConfig field names and raw HiddenSwitch keys. Treat typed names (port, vram_policy, cache_policy, warm_policy, reserve_vram_gb) as direct routes to typed dataclass fields. Treat raw HS keys (reserve_vram, cache_none, --highvram, etc.) via the existing HiddenSwitch translation path. Unknown keys go to extra. Tests in Step 7.3 expect typed-name daemon config carry-through; tests for the embedded path may also feed raw HS keys.
code
Batch framing:
- Execute batch 1 of 7.
- Actionable task IDs for this batch: ['T1']
- Already completed task IDs available as dependency context: []
Actionable tasks for this batch:
[
{
"id": "T1",
"description": "Create vibecomfy/runtime/session.py and relocate shared runtime helpers from run.py. Move RunResult (run.py:19-25), _prepare_prompt (run.py:28-42), _run_metadata (run.py:76-96), _collect_output_paths (run.py:204-215), _git_sha (run.py:99-109), and the body of _embedded_configuration (run.py:163-181) into session.py \u2014 run.py imports from session.py, never the reverse. Update vibecomfy/runtime/init.py:1-11 so from vibecomfy.runtime import RunResult keeps working (re-export through run.py). Define: (a) SessionConfig dataclass with fields vram_policy/reserve_vram_gb/cache_policy/disable_smart_memory/warm_policy/auto_flush_vram_threshold_gb/port/extra. (b) Private _partition_comfy_config(d) that splits a dict into typed-field kwargs vs extra \u2014 accepts BOTH typed SessionConfig field names AND raw HiddenSwitch keys per the FLAG-012 mapping table (typed names port/vram_policy/cache_policy/warm_policy/reserve_vram_gb/disable_smart_memory/auto_flush_vram_threshold_gb route directly; raw HS keys reserve_vram\u2192reserve_vram_gb, highvram/lowvram/normalvram\u2192vram_policy, cache_none/cache_classic/cache_lru\u2192cache_policy; unknown\u2192extra). Conflict precedence: apply HS-translated keys first, then typed-name keys overwrite. (c) SessionConfig.from_dict(d) and SessionConfig.from_workflow_metadata(workflow) (delegates to from_dict on workflow.metadata.get('comfy_configuration', {})). (d) class VibeSession(Protocol) with start/run/flush/reconfigure/stop and last_fingerprint attr. (e) class EmbeddedSession(VibeSession) holding one long-lived Comfy() across calls (start instantiates Comfy with _embedded_configuration_for_session, queue_prompt_api in run, clear_cache in flush, reconfigure passes a new Configuration, stop tolerates model_mmap_residency AttributeError). (f) _embedded_configuration_for_session(config: SessionConfig) -> Configuration | None (apply order: typed fields \u2192 config.extra \u2192 VIBECOMFY_COMFY_CONFIGURATION env override; returns None if merged dict empty matching run.py:174-175). (g) _embedded_configuration(workflow) -> Configuration | None thin wrapper around _embedded_configuration_for_session(SessionConfig.from_workflow_metadata(workflow)) \u2014 preserves existing public signature. (h) Pattern-based model_fingerprint(api_dict) -> tuple \u2014 any class_type containing 'Loader' (and not in OVERRIDES_EXCLUDE), plus members of OVERRIDES_INCLUDE, contributes its non-edge string-valued input slots as sorted (class_type, slot, value) triples; OVERRIDES sets start empty.",
"depends_on": [],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
}
]
code
Completed task context (already satisfied, do not re-execute unless directly required by current edits):
[]
Prior batch deviations (address if applicable):
None
Batch-scoped sense checks:
[
{
"id": "SC1",
"task_id": "T1",
"question": "Does session.py contain VibeSession Protocol, SessionConfig (with extra field), EmbeddedSession, _embedded_configuration_for_session, _embedded_configuration (workflow-taking wrapper), model_fingerprint, plus the relocated RunResult/_prepare_prompt/_run_metadata/_collect_output_paths/_git_sha \u2014 and does run.py import from session.py with no reverse import?",
"executor_note": "Verify by reading session.py top-to-bottom for the named exports, then python -c 'import vibecomfy.runtime.session; import vibecomfy.runtime.run' \u2014 if the second import path triggers a re-import warning or ImportError the relocation introduced a cycle. Confirm runtime/init.py still re-exports RunResult.",
"verdict": ""
},
{
"id": "SC2",
"task_id": "T1",
"question": "Does _partition_comfy_config accept BOTH typed SessionConfig field names (port, vram_policy, cache_policy, warm_policy, reserve_vram_gb, disable_smart_memory, auto_flush_vram_threshold_gb) AND raw HiddenSwitch keys (reserve_vram, highvram/lowvram/normalvram, cache_none/cache_classic/cache_lru) in the same dict, with documented HS-first-then-typed-overwrite precedence?",
"executor_note": "Read _partition_comfy_config implementation and confirm the conflict-precedence comment matches Step 1.3 of the plan. Spot-check by running tests/test_runtime_session.py case 8 (typed-vs-HS conflict) and case 7 (mixed input).",
"verdict": ""
}
]
code
Full execution tracking source of truth (`finalize.json`):
{
"tasks": [
{
"id": "T1",
"description": "Create vibecomfy/runtime/session.py and relocate shared runtime helpers from run.py. Move RunResult (run.py:19-25), _prepare_prompt (run.py:28-42), _run_metadata (run.py:76-96), _collect_output_paths (run.py:204-215), _git_sha (run.py:99-109), and the body of _embedded_configuration (run.py:163-181) into session.py \u2014 run.py imports from session.py, never the reverse. Update vibecomfy/runtime/init.py:1-11 so from vibecomfy.runtime import RunResult keeps working (re-export through run.py). Define: (a) SessionConfig dataclass with fields vram_policy/reserve_vram_gb/cache_policy/disable_smart_memory/warm_policy/auto_flush_vram_threshold_gb/port/extra. (b) Private _partition_comfy_config(d) that splits a dict into typed-field kwargs vs extra \u2014 accepts BOTH typed SessionConfig field names AND raw HiddenSwitch keys per the FLAG-012 mapping table (typed names port/vram_policy/cache_policy/warm_policy/reserve_vram_gb/disable_smart_memory/auto_flush_vram_threshold_gb route directly; raw HS keys reserve_vram\u2192reserve_vram_gb, highvram/lowvram/normalvram\u2192vram_policy, cache_none/cache_classic/cache_lru\u2192cache_policy; unknown\u2192extra). Conflict precedence: apply HS-translated keys first, then typed-name keys overwrite. (c) SessionConfig.from_dict(d) and SessionConfig.from_workflow_metadata(workflow) (delegates to from_dict on workflow.metadata.get('comfy_configuration', {})). (d) class VibeSession(Protocol) with start/run/flush/reconfigure/stop and last_fingerprint attr. (e) class EmbeddedSession(VibeSession) holding one long-lived Comfy() across calls (start instantiates Comfy with _embedded_configuration_for_session, queue_prompt_api in run, clear_cache in flush, reconfigure passes a new Configuration, stop tolerates model_mmap_residency AttributeError). (f) _embedded_configuration_for_session(config: SessionConfig) -> Configuration | None (apply order: typed fields \u2192 config.extra \u2192 VIBECOMFY_COMFY_CONFIGURATION env override; returns None if merged dict empty matching run.py:174-175). (g) _embedded_configuration(workflow) -> Configuration | None thin wrapper around _embedded_configuration_for_session(SessionConfig.from_workflow_metadata(workflow)) \u2014 preserves existing public signature. (h) Pattern-based model_fingerprint(api_dict) -> tuple \u2014 any class_type containing 'Loader' (and not in OVERRIDES_EXCLUDE), plus members of OVERRIDES_INCLUDE, contributes its non-edge string-valued input slots as sorted (class_type, slot, value) triples; OVERRIDES sets start empty.",
"depends_on": [],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T2",
"description": "Add the auto-flush gate inside EmbeddedSession.run in session.py. Before queueing: compute fp = model_fingerprint(api_dict). Resolve effective warm policy: os.environ.get('VIBECOMFY_WARM') overrides config.warm_policy. Behavior: 'never' \u2192 flush() then queue; 'always' \u2192 never auto-flush; 'auto' \u2192 flush iff . After successful queue: self.last_fingerprint = fp. Add helper that lazily imports and returns float('inf') on any ImportError/AttributeError so missing GPU/torch doesn't break the gate.",
"depends_on": [
"T1"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T3",
"description": "Refactor run_embedded() in vibecomfy/runtime/run.py:116-156 to be a thin wrapper around EmbeddedSession.start()/run()/stop(). Public signatures of run_embedded and run_embedded_sync MUST remain unchanged. Delete the relocated helper bodies from run.py and import them from session.py. Re-export _embedded_configuration from run.py so continues to resolve (commands/doctor.py:56 and tests/test_runtime_run.py:116 depend on this). Verify vibecomfy/commands/doctor.py:56-60 still works without modification (it passes a VibeWorkflow, which routes through the wrapper).",
"depends_on": [
"T1",
"T2"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T4",
"description": "Create tests/test_runtime_session.py for EmbeddedSession. Reuse the sys.modules injection pattern from tests/test_runtime_run.py:140-149. FakeComfy records enter/exit counts plus queue_prompt_api/clear_cache/reconfigure call args. Required cases: (1) two sequential session.run(workflow_a) calls produce exactly one / pair. (2) flush() invokes clear_cache() exactly once. (3) reconfigure(SessionConfig(...)) passes a Configuration whose typed fields reflect SessionConfig. (4) carry-through (raw HS): metadata \u2192 config.reserve_vram_gb == 12, cache_policy == 'none', extra == {fp8_e4m3fn_text_enc: True}; then _embedded_configuration_for_session yields Configuration with all three keys. (5) mirror with same raw-HS dict produces identical SessionConfig. (6) typed names: \u2192 SessionConfig(port=8200, vram_policy='high', reserve_vram_gb=2.0, cache_policy='lru:3', warm_policy='always', extra={}). (7) mixed: \u2192 SessionConfig(port=8200, reserve_vram_gb=12, extra={fp8_e4m3fn_text_enc: True}). (8) typed-vs-HS conflict: resolves to reserve_vram_gb == 2.0. (9) empty: \u2192 all defaults, empty extra. (10) Pattern-based fingerprint snapshot tests: (UNETLoader/CLIPLoader/VAELoader widget_0), (LowVRAMCheckpointLoader, LowVRAMAudioVAELoader, LTXAVTextEncoderLoader, LoraLoaderModelOnly), synthetic dict with DualCLIPLoaderGGUF/UnetLoaderGGUF \u2014 assert edge references (list values) NOT included. (11) Auto-flush truth table with mocked _free_vram_gb: same fingerprint + low VRAM \u2192 no flush; different fingerprint + low VRAM \u2192 flush; different fingerprint + high VRAM \u2192 no flush; same loader + different KSampler seed \u2192 no flush. (12) VIBECOMFY_WARM=never flushes before every run; VIBECOMFY_WARM=always never auto-flushes. Confirm existing tests/test_runtime_run.py:98-121 (test_embedded_configuration_uses_hiddenswitch_configuration_object) passes unchanged.",
"depends_on": [
"T1",
"T2",
"T3"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T5",
"description": "Add ServerSession backend in session.py. Extract subprocess startup from runtime/server.py:27-41 into in session.py. Translate SessionConfig to CLI flags: (skip when 'auto'), , , (skip when 'smart'), . Reuse the 120-iteration /system_stats readiness loop. Add : start() calls _spawn_comfy_server; run() calls ComfyClient(self.url).queue_prompt(api_dict) wrapped by the same auto-flush gate from T2; flush() POSTs /api/free with ; reconfigure(config) is restart-on-change (compare CLI argv); stop() SIGTERM with 15s timeout fallback to SIGKILL. Add in runtime/client.py:30+ with a one-line docstring noting queue-async semantics.",
"depends_on": [
"T1",
"T2"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T6",
"description": "Create vibecomfy/commands/session.py with argparse for start/stop/list/flush/status AND in-process daemon entrypoint (single file). Daemon invocation: . Daemon body: . Daemonize from via . Parent assembles config dict from CLI flags as TYPED-NAME dict matching SessionConfig field names (omit None values): . Parent waits up to 120 s for out/sessions//url. Subcommands: , , , , . Add in runtime/session.py: read out/sessions//url; if pidfile present and os.kill(pid, 0) succeeds return URL else clean up and return None. Register CommandSpec('session', 'vibecomfy.commands.session') in vibecomfy/commands/.py:14-28 BETWEEN 'runtime' and 'logs'. Update tests/test_cli.py:25-40 to insert 'session' between 'runtime' and 'logs' in the asserted ordered list. Make warm-managed default for (vibecomfy/commands/run.py): change --runtime default from 'embedded' to 'auto'; at top of _cmd_run BEFORE get_schema_provider, when args.runtime in ('auto','server') and --server-url not set, call find_active_session('default'); resolve effective runtime (auto + warm \u2192 server@URL, auto + no warm \u2192 embedded one-shot, server + warm \u2192 reuse, server + no warm \u2192 existing one-shot managed). Pass URL into both get_schema_provider('auto', server_url=session_url) AND run_sync(..., server_url=session_url, ...).",
"depends_on": [
"T5"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T7",
"description": "Add ServerSession + CLI tests. In tests/test_runtime_session.py append ServerSession tests with monkeypatched asyncio.create_subprocess_exec and stub httpx.AsyncClient. Required cases: (1) start() invokes subprocess with expected CLI argv given SessionConfig(vram_policy='high', reserve_vram_gb=2.0, cache_policy='lru:3', disable_smart_memory=True, port=8200) \u2014 assert --highvram, --reserve-vram 2.0, --cache-lru 3, --disable-smart-memory, --port 8200. (2) two session.run(...) calls share one subprocess (spawn count == 1). (3) flush() POSTs /api/free with {unload_models: True, free_memory: True}. (4) reconfigure(same_config) is a no-op; reconfigure(different_cli_args) triggers stop+start. (5) stop() SIGTERMs once, falls back to SIGKILL after 15 s. Create tests/test_session_cli.py: mock subprocess.Popen so 'daemon' is replaced by a synchronous helper that writes out/sessions//{pid,url,config.json} with synthetic alive pid. Assert: start returns 0 + creates files; list prints active id+URL; flush calls ComfyClient.free(True, True); stop removes files; find_active_session returns URL when pid alive, None (and cleans up) when pid dead. Add daemon-config carry-through tests (FLAG-012): (a) typed-name path \u2014 directly call daemon entrypoint with parsed \u2192 ServerSession constructor receives SessionConfig(port=8200, vram_policy='high', reserve_vram_gb=2.0, cache_policy='lru:3', warm_policy='always', extra={}) (mock ServerSession.start to record). (b) raw HS path \u2014 \u2192 ServerSession(SessionConfig(reserve_vram_gb=12, cache_policy='none', port=8200, extra={fp8_e4m3fn_text_enc:True})). Add tests/test_runtime_run.py regression: _cmd_run with --runtime auto and a fake active session in out/sessions/default/url calls run_sync with that URL AND constructs schema provider with same URL. Add a regression case: --runtime auto with no active session falls back to embedded one-shot.",
"depends_on": [
"T6"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T8",
"description": "Update documentation. (1) Append 'Warm sessions' section to docs/runtime_lifecycle.md covering: Embedded vs Server backends, the CLI (start/stop/list/flush/status), warm-policy rules (auto|always|never), /api/free queue-flag semantics (async, takes effect at next prompt boundary), VIBECOMFY_WARM env override, the pattern-based loader fingerprint (any class_type containing 'Loader' contributes non-edge string-valued slots), the SessionConfig.extra escape hatch, and the new default routing. (2) Append a VibeSession API block to docs/runtime_surface.md under 'Embedded Surface' (start/run/flush/reconfigure/stop + SessionConfig fields including extra). (3) Update docs/runtime_lifecycle.md:3 to reflect now defaults to .",
"depends_on": [
"T6",
"T7"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T9",
"description": "Create scripts/warm_session_smoke.py \u2014 a manual GPU smoke script that runs two cheap workflows back-to-back through one EmbeddedSession and prints elapsed deltas. Must not be wired into automated test runs. Should print comfy.model_management.current_loaded_models length between calls (info-only) so an operator can confirm warmth.",
"depends_on": [
"T1",
"T2",
"T3"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T10",
"description": "Run validation. Execute in this order: (1) \u2014 confirm registry assertion still passes after adding 'session'. (2) \u2014 run_embedded refactor + helper relocation preserves existing behavior; test_embedded_configuration_uses_hiddenswitch_configuration_object passes via re-exported wrapper; new --runtime auto fallback case passes. (3) \u2014 embedded + server session unit tests including from_workflow_metadata/from_dict partition tests and pattern-based fingerprint snapshots. (4) \u2014 daemon CLI flow + daemon-config carry-through (typed and raw HS paths). (5) Full \u2014 confirm no collateral damage; vibecomfy/commands/doctor.py:56-60 still imports _embedded_configuration from runtime.run and passes a VibeWorkflow without modification. If any test fails, read the error, fix the code, and re-run until they pass. Do NOT create new test files beyond the two named in T4/T7. Then write a short throwaway script that reproduces the warm-session bug (create EmbeddedSession, run twice, assert FakeComfy enter/exit count == 1; or create ServerSession with mocked subprocess, run twice, assert spawn count == 1), run it to confirm the fix works, then delete it.",
"depends_on": [
"T1",
"T2",
"T3",
"T4",
"T5",
"T6",
"T7",
"T8",
"T9"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
}
],
"watch_items": [
"FLAG-012 (must): _partition_comfy_config MUST accept BOTH typed SessionConfig field names AND raw HiddenSwitch keys in the same dict. Conflict precedence: HS-translated keys applied first, typed-name keys overwrite. The typed-vs-HS conflict test (T4 case 8) is the canonical assertion.",
"FLAG-010/callers (must): _embedded_configuration KEEPS its existing public signature. Three current callers \u2014 vibecomfy/runtime/run.py:125, tests/test_runtime_run.py:116, vibecomfy/commands/doctor.py:56-60 \u2014 MUST work without modification. The actual logic moves to _embedded_configuration_for_session(config: SessionConfig); the workflow-taking helper is a one-line wrapper. run.py re-exports it so keeps resolving.",
"FLAG-007/circular import: relocation direction is one-way \u2014 run.py imports from session.py, never the reverse. Verify after T1 with .",
"FLAG-006 fingerprint scope: the extractor is PATTERN-BASED ('Loader' substring), NOT a hard-coded class list. Empty OVERRIDES_INCLUDE/OVERRIDES_EXCLUDE sets reserved for future exceptions. The synthetic-dict + ltx2_3_t2v.api.json snapshot tests in T4 are the proof.",
"Edge references (list values like ) on a loader node must NOT be included in the fingerprint \u2014 only non-edge string-valued slots. Test must assert this explicitly.",
"FLAG-008/test_cli.py registry: when adding between 'runtime' and 'logs', the existing exact-ordered COMMANDS assertion at tests/test_cli.py:25-40 will break unless updated in the same diff. T6 includes this update.",
"FLAG-002 warm-default: --runtime default flips from 'embedded' to 'auto'. With no warm session present, behavior MUST remain backwards-compatible (embedded one-shot). The fallback regression test in T7 covers this.",
"FLAG-004 schema-provider URL plumbing: get_schema_provider construction in _cmd_run must happen AFTER find_active_session and receive the discovered URL via server_url=session_url. Otherwise a second cold runtime would spawn for /object_info \u2014 the bug the brief explicitly calls out.",
"/api/free is QUEUE-ASYNC (sets prompt_queue.set_flag), NOT synchronous unload. Tests assert payload + endpoint, not actual model-unload completion. ComfyClient.free docstring must call this out.",
"stop() must tolerate AttributeError on Comfy. (this is the cleanup path that nukes warm state at embedded_comfy_client.py:_cleanup; tolerate it on shutdown).",
"_free_vram_gb() must not crash on missing torch/comfy import \u2014 return float('inf') so the auto-flush gate is conservative on dev mac.",
"SessionConfig field-name vs raw-HS-key collision (e.g. caller passes both and in one dict): apply HS-translated keys first, typed-name keys overwrite. Document in _partition_comfy_config docstring.",
"Daemon spawn uses so the daemon survives parent shell exit. Pidfile + URL file land under out/sessions// with default id 'default'. Stale pidfile auto-cleanup when recorded pid is dead.",
"Auto-flush threshold default = 2.0 GB free VRAM. ServerSession default port 8188 with --port override.",
"find_active_session must clean up stale pidfile/url files when os.kill(pid, 0) raises ProcessLookupError, then return None \u2014 otherwise warm-default routing will keep trying to attach to dead daemons.",
"Manual GPU smoke (T9) cannot run on dev mac \u2014 info-only criterion. Test-layer subprocess-spawn-count + /api/free payload assertions are the actual verification gate for managed-mode warmth.",
"Existing run_embedded and run_sync public signatures MUST remain unchanged. They become thin wrappers around the new session abstraction; backwards compatibility is a hard requirement.",
"Subjective_judgment 'should' criteria \u2014 session.py under ~550 lines and docs quality in runtime_lifecycle.md/runtime_surface.md \u2014 require human inspection. Don't break them, but they're not test-gated.",
"No new runtime dependencies in pyproject.toml \u2014 httpx + stdlib only.",
"When relocating helpers, watch for imports of these names elsewhere in the codebase. Only run.py:_embedded_configuration is documented as having external callers (doctor.py + tests/test_runtime_run.py); the others (RunResult, _prepare_prompt, _run_metadata, _collect_output_paths, _git_sha) move freely. RunResult must still be importable as via re-export.",
"Tests use the sys.modules injection pattern from tests/test_runtime_run.py:140-149 \u2014 no new test deps; pyproject.toml stays at httpx + pytest + pytest-asyncio."
],
"sense_checks": [
{
"id": "SC1",
"task_id": "T1",
"question": "Does session.py contain VibeSession Protocol, SessionConfig (with field), EmbeddedSession, _embedded_configuration_for_session, _embedded_configuration (workflow-taking wrapper), model_fingerprint, plus the relocated RunResult/_prepare_prompt/_run_metadata/_collect_output_paths/_git_sha \u2014 and does run.py import from session.py with no reverse import?",
"executor_note": "Verify by reading session.py top-to-bottom for the named exports, then \u2014 if the second import path triggers a re-import warning or ImportError the relocation introduced a cycle. Confirm runtime/.py still re-exports RunResult.",
"verdict": ""
},
{
"id": "SC2",
"task_id": "T1",
"question": "Does _partition_comfy_config accept BOTH typed SessionConfig field names (port, vram_policy, cache_policy, warm_policy, reserve_vram_gb, disable_smart_memory, auto_flush_vram_threshold_gb) AND raw HiddenSwitch keys (reserve_vram, highvram/lowvram/normalvram, cache_none/cache_classic/cache_lru) in the same dict, with documented HS-first-then-typed-overwrite precedence?",
"executor_note": "Read _partition_comfy_config implementation and confirm the conflict-precedence comment matches Step 1.3 of the plan. Spot-check by running tests/test_runtime_session.py case 8 (typed-vs-HS conflict) and case 7 (mixed input).",
"verdict": ""
},
{
"id": "SC3",
"task_id": "T2",
"question": "Does the auto-flush gate honor VIBECOMFY_WARM (never\u2192pre-flush, always\u2192never auto-flush, auto\u2192fingerprint-change-and-low-VRAM), and does _free_vram_gb return float('inf') on import failure rather than crashing?",
"executor_note": "Trace EmbeddedSession.run with each VIBECOMFY_WARM value mocked. Independently call _free_vram_gb in an environment without comfy.model_management to confirm float('inf') return.",
"verdict": ""
},
{
"id": "SC4",
"task_id": "T3",
"question": "Are run_embedded/run_embedded_sync public signatures unchanged, does run.py re-export _embedded_configuration so commands/doctor.py:56 keeps working, and have all relocated helper bodies been deleted from run.py (only imports remain)?",
"executor_note": "Diff run.py against HEAD: helper definitions should be gone, only imports remain. should still resolve in a one-line REPL test.",
"verdict": ""
},
{
"id": "SC5",
"task_id": "T4",
"question": "Do the embedded-session tests cover all 12 required cases (sequential-runs single enter/exit, flush, reconfigure, from_workflow_metadata raw HS, from_dict raw HS mirror, from_dict typed names, from_dict mixed, typed-vs-HS conflict, empty, pattern-based fingerprint snapshots \u00d7 3, auto-flush truth table, VIBECOMFY_WARM=never/always) \u2014 including the explicit assertion that edge references (list values) are NOT included in the fingerprint?",
"executor_note": "Run and grep the test names against the 12-case checklist. The edge-reference exclusion test is easy to forget \u2014 confirm it appears as its own assertion line.",
"verdict": ""
},
{
"id": "SC6",
"task_id": "T5",
"question": "Does ServerSession.start() spawn comfyui serve once and translate SessionConfig to the expected CLI argv (--highvram|--lowvram|--normalvram, --reserve-vram, --disable-smart-memory, --cache-classic|--cache-lru N|--cache-none, --port), and does flush() POST /api/free with {unload_models:True, free_memory:True} via the new ComfyClient.free?",
"executor_note": "Verify CLI flag translation by running the T7 argv test. Check ComfyClient.free includes the queue-async docstring. Confirm the auto-flush gate from T2 wraps ServerSession.run too (not just EmbeddedSession).",
"verdict": ""
},
{
"id": "SC7",
"task_id": "T6",
"question": "Is the daemon entrypoint a single file at vibecomfy/commands/session.py invokable via , does the parent assemble the typed-name config dict, does thread the discovered URL into BOTH get_schema_provider AND run_sync, and is tests/test_cli.py:25-40 updated to include 'session' between 'runtime' and 'logs'?",
"executor_note": "Inspect run.py _cmd_run to confirm find_active_session is called BEFORE get_schema_provider, with the URL passed to both call sites. Run \u2014 if the registry assertion fails, the test wasn't updated.",
"verdict": ""
},
{
"id": "SC8",
"task_id": "T7",
"question": "Do the ServerSession + CLI tests assert spawn count == 1 across two runs, /api/free payload, daemon-config carry-through for BOTH typed-name and raw-HS JSON shapes, AND the auto-default fallback behavior (warm session attaches; no warm session falls back to embedded one-shot)?",
"executor_note": "Spot-check the FLAG-012 daemon test specifically \u2014 it must have two sub-cases (typed-name and raw-HS) with the constructor argument captured via a mock. Confirm the no-active-session fallback test exercises embedded one-shot rather than failing.",
"verdict": ""
},
{
"id": "SC9",
"task_id": "T8",
"question": "Do docs/runtime_lifecycle.md and docs/runtime_surface.md cover both backends, the session CLI, warm-policy rules, /api/free queue-async semantics, VIBECOMFY_WARM, the pattern-based fingerprint, the SessionConfig.extra escape hatch, and the new default?",
"executor_note": "Read both docs end-to-end. The /api/free queue-async note and the SessionConfig.extra escape-hatch note are easy to forget \u2014 grep for both keywords.",
"verdict": ""
},
{
"id": "SC10",
"task_id": "T9",
"question": "Does scripts/warm_session_smoke.py exercise EmbeddedSession (not ServerSession) so the second-call timing actually reflects in-process model warmth, and does it print current_loaded_models length between calls?",
"executor_note": "Embedded backend is mandated because ServerSession returns after queue submission and can't measure actual warmth. Confirm the script imports EmbeddedSession and not ServerSession.",
"verdict": ""
},
{
"id": "SC11",
"task_id": "T10",
"question": "Does the full pytest suite pass, including the ordered validation steps (test_cli first, then test_runtime_run, test_runtime_session, test_session_cli, then full pytest), and was a throwaway repro script run to confirm the warm-session fix and then deleted?",
"executor_note": "Capture each pytest invocation's exit status. The throwaway repro script must be deleted after the run \u2014 verify with showing no new untracked files outside the planned set.",
"verdict": ""
}
],
"meta_commentary": "Plan size is large (~10 tasks across three phases). Recommended execution order matches plan validation order: Phase 1 first (T1\u2192T2\u2192T3\u2192T4), then Phase 2 (T5\u2192T6\u2192T7), then docs (T8) and smoke (T9), then T10 to validate. Critical correctness traps to remember while executing: (1) The _partition_comfy_config dual-vocabulary contract is the single most-flagged correctness item across five gate iterations \u2014 both typed SessionConfig field names AND raw HiddenSwitch keys must be accepted in one dict; the typed-vs-HS conflict test (T4 case 8) and the daemon carry-through test (T7) are the canonical assertions. Get this wrong and the FLAG-012 work was wasted. (2) _embedded_configuration MUST keep its signature unchanged. The new logic lives in _embedded_configuration_for_session(SessionConfig); the workflow-taking helper is a one-line wrapper that routes through SessionConfig.from_workflow_metadata. Don't change the public signature. (3) Helper relocation is one-way (run.py imports session.py, never the reverse). The circular import was specifically called out and resolved \u2014 don't reintroduce it. (4) Pattern-based fingerprint, NOT a hard-coded class list. Anything containing 'Loader' (and not in OVERRIDES_EXCLUDE) qualifies. Edge references (list values) are excluded \u2014 string values only. (5) Warm-default routing: --runtime default flips from 'embedded' to 'auto'. The schema-provider URL must be threaded BEFORE get_schema_provider construction so a second cold runtime doesn't spawn for /object_info. Both run_sync AND get_schema_provider receive the same URL. (6) test_cli.py:25-40 has an exact-ordered COMMANDS assertion \u2014 it WILL break when 'session' is registered unless updated in the same change. (7) /api/free is queue-async; tests assert payload, not synchronous unload completion. (8) Daemon spawn uses start_new_session=True; pidfile + URL files under out/sessions//. find_active_session cleans up stale pidfiles when os.kill(pid, 0) raises. (9) GPU smoke (T9) is info-only; the dev mac can't run it. The test layer (spawn count == 1 + /api/free payload) is the real warmth-verification gate. Read tests/test_runtime_run.py:140-149 first to copy the sys.modules injection pattern \u2014 all new tests use it. The plan went through 5 critique iterations; trust the settled decisions in the plan body and don't second-guess them.",
"validation": {
"plan_steps_covered": [
{
"plan_step_summary": "Step 1: Create vibecomfy/runtime/session.py with VibeSession Protocol, SessionConfig (with extra + from_dict + from_workflow_metadata + dual-vocabulary _partition_comfy_config), EmbeddedSession, _embedded_configuration_for_session, _embedded_configuration wrapper, pattern-based model_fingerprint; relocate shared runtime helpers from run.py; update runtime/.py re-export",
"finalize_task_ids": [
"T1"
]
},
{
"plan_step_summary": "Step 2: Add auto-flush gate inside EmbeddedSession.run with VIBECOMFY_WARM override and _free_vram_gb helper",
"finalize_task_ids": [
"T2"
]
},
{
"plan_step_summary": "Step 3: Refactor run_embedded into one-shot wrapper around EmbeddedSession; delete relocated helper bodies from run.py; re-export _embedded_configuration",
"finalize_task_ids": [
"T3"
]
},
{
"plan_step_summary": "Step 4: Tests for embedded session \u2014 sequential-runs warmth, flush, reconfigure, from_workflow_metadata + from_dict partition tests (raw-HS, typed-name, mixed, conflict, empty), pattern-based fingerprint snapshots, auto-flush truth table, VIBECOMFY_WARM cases",
"finalize_task_ids": [
"T4"
]
},
{
"plan_step_summary": "Step 5: ServerSession backend with _spawn_comfy_server CLI-flag translation, /api/free flush, restart-on-change reconfigure, SIGTERM/SIGKILL stop; ComfyClient.free helper",
"finalize_task_ids": [
"T5"
]
},
{
"plan_step_summary": "Step 6: Daemon CLI vibecomfy/commands/session.py (start/stop/list/flush/status + --daemon entrypoint), find_active_session, register CommandSpec, update tests/test_cli.py registry assertion, change vibecomfy run --runtime default to auto with URL threading into get_schema_provider AND run_sync",
"finalize_task_ids": [
"T6"
]
},
{
"plan_step_summary": "Step 7: Tests for ServerSession (subprocess argv, spawn-count==1, flush payload, reconfigure no-op vs restart, SIGTERM\u2192SIGKILL) + CLI (start/stop/list/flush, find_active_session pid-alive/dead, daemon-config carry-through for typed and raw-HS shapes) + auto-default routing regression in test_runtime_run.py",
"finalize_task_ids": [
"T7"
]
},
{
"plan_step_summary": "Step 8: Append Warm sessions section to docs/runtime_lifecycle.md and VibeSession API block to docs/runtime_surface.md; update docs/runtime_lifecycle.md:3 to reflect auto default",
"finalize_task_ids": [
"T8"
]
},
{
"plan_step_summary": "Step 9: Add scripts/warm_session_smoke.py manual GPU smoke using EmbeddedSession with elapsed deltas + current_loaded_models inspection",
"finalize_task_ids": [
"T9"
]
},
{
"plan_step_summary": "Validation: ordered pytest runs (test_cli, test_runtime_run, test_runtime_session, test_session_cli, full pytest) + throwaway repro script",
"finalize_task_ids": [
"T10"
]
}
],
"orphan_tasks": [],
"completeness_notes": "All 9 plan steps map to dedicated tasks T1\u2013T9; T10 covers the plan's 5-step validation order plus the throwaway-repro requirement. The only plan content not broken into a separate task is the validation order itself, which is consolidated inside T10 (the executor must run the steps in the listed order so registry/refactor failures surface first). The 'should' subjective criteria (line-count cap, doc quality, no new deps) are tracked in watch_items rather than as separate tasks because they're cross-cutting checks during T1/T8.",
"coverage_complete": true
},
"baseline_test_failures": [],
"baseline_test_command": "pytest --tb=no -q --no-header",
"baseline_test_note": "Baseline not run during finalize (this is a planning-only step). T10 begins with the ordered validation sequence: pytest tests/test_cli.py \u2192 pytest tests/test_runtime_run.py \u2192 pytest tests/test_runtime_session.py \u2192 pytest tests/test_session_cli.py \u2192 full pytest. The executor should snapshot a baseline run BEFORE starting T1 to identify any pre-existing failures that should be ignored, then ensure no new failures are introduced."
}
code
Debt watch items (do not make these worse):
[DEBT] are-the-proposed-changes-technically-correct: are the proposed changes technically correct?: for ordinary pairs, the new diagnosis is not well-supported by the repo. the current sync effect in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/tools/travel-between-images/components/shotimageseditor/hooks/usesegmentslotmode.ts already syncs url and primaryvariantid, and the regenerate path reads exactly starturl, endurl, startgenid, endgenid, startvariantid, and endvariantid from segmentslotmode.pairdata in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/domains/media-lightbox/hooks/usevideoregeneratemode.ts. adding thumburl and generationid to the sync does not, by itself, explain why an old image url is still being used for regular pairs. (flagged 1 times across 1 plans)
[DEBT] are-the-proposed-changes-technically-correct: are the proposed changes technically correct?: the fix is incomplete for extra trailing slots. handlepairclick can populate activepairdata from trailingpairdata when pairindex === pairdatabyindex.size in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/tools/travel-between-images/components/shotimageseditor/hooks/usesegmentslotmode.ts, but the proposed sync effect only reads pairdatabyindex.get(segmentslotlightboxindex). for those trailing-slot cases fresh is undefined, so no image refresh happens. (flagged 1 times across 1 plans)
[DEBT] are-the-proposed-changes-technically-correct: are the proposed changes technically correct?: the merge pseudocode does not actually sync 'all image fields' as claimed. it omits id and position from change detection, and when fresh.startimage or fresh.endimage becomes null it preserves the stale previous object instead of syncing that null state. as written, it also needs explicit null-guards around spreads of prev.startimage / prev.endimage to be safe in strict typescript. (flagged 1 times across 1 plans)
[DEBT] are-the-proposed-changes-technically-correct: are the proposed changes technically correct?: the plan's claim that worker_state.py:200-204 (the 30-minute startup safety net) catches abandoned pods that exited before patching is slightly imprecise. line 200-204 only runs when in_startup_phase is true, which requires startup_phase to be in ('deps_installing', 'deps_verified', 'worker_starting') per line 161. a pod that exits before its first patch has startup_phase = none, so in_startup_phase is false and the code falls through to the normal timeout checks (active_stale / not_claiming) at line 207+, not the 30-minute startup cap. both paths eventually reap the worker, so the end result is the same, but the overview's reasoning (naming 200-204 specifically) is wrong. worth correcting so future readers don't mis-reason about the invariant. (flagged 1 times across 1 plans)
[DEBT] are-the-proposed-changes-technically-correct: are the proposed changes technically correct?: checked worker_state.py line 161 (in_startup_phase = startup_phase in (...)) against the plan's assumption that subsequent lenient writes are safe. if deps_installing succeeds but deps_verified silently fails, startup_phase stays at 'deps_installing' and the 30-minute cap from line 200-204 applies — even though the pod is actually progressing through uv sync. on a slow runpod image with cold wheel downloads, uv sync --extra cuda124 plus wan2gp deps can take 20+ minutes. there's no concrete benchmark in the plan that says the 30-minute cap is safely above the expected sync time; if uv sync legitimately takes 25 minutes and the deps_verified patch fails on a transient network blip, the orchestrator will terminate a healthy pod. plan should either bump the cap or note that deps_verified swallowing is acceptable because the cap is generously above typical sync time. (flagged 1 times across 1 plans)
[DEBT] are-the-proposed-changes-technically-correct: are the proposed changes technically correct?: the path-mapping defect from the previous iteration is fixed, but a different technical gap remains around self_refiner. repository search shows shared.utils.self_refiner is imported by wan2gp/wgp.py, wan2gp/models/ltx2/ltx_pipelines/distilled.py, ti2vid_one_stage.py, ti2vid_two_stages.py, wan2gp/models/ltx2/ltx_pipelines/utils/helpers.py, and wan2gp/models/wan/any2video.py; the v4 plan still aligns wan2gp/shared/utils/self_refiner.py to upstream head without any concrete runtime step that exercises those code paths after the change, so the only repo-documented behavior check for that file is still missing from the executable body. (flagged 1 times across 1 plans)
[DEBT] are-the-success-criteria-well-prioritized-and-verifiable: are the success criteria well-prioritized and verifiable?: the attached success criteria are stale and do not match the current plan body. they still require 'no usestate for activepairdata', 'setactivepairdata fully removed', 'sync effect deleted', and 'onpairclick simplified to (pairindex: number) => void', which are the opposite of the current targeted-sync plan. as presented, the criteria are not usable for review or execution. (flagged 1 times across 1 plans)
[DEBT] audio-loading: getaudiodata in useeffect removes render-readiness signal (flagged 1 times across 1 plans)
[DEBT] audio-loading: same as correctness-3 — preview/render parity risk (flagged 1 times across 1 plans)
[DEBT] audio-loading: preview/render parity partially satisfied (flagged 1 times across 1 plans)
[DEBT] audio-reactivity: overlapping clips use first-found, volume not scaled (flagged 1 times across 1 plans)
[DEBT] audio-reactivity: same as audio-reactivity-1 — overlapping/volume-adjusted clips diverge from audible mix (flagged 1 times across 1 plans)
[DEBT] audio-reactivity: textclip missing globalframeprovider (flagged 1 times across 1 plans)
[DEBT] audio-reactivity: same as audio-reactivity-2 — textclipsequence missing provider (flagged 1 times across 1 plans)
[DEBT] audio-reactivity: textclip effects surface not covered (flagged 1 times across 1 plans)
[DEBT] audio-reactivity: continuous effects shared by visual and text clips (flagged 1 times across 1 plans)
[DEBT] batch-generation-pipeline: enhancement in usegeneratebatch before generatevideo() could compute prompts against a stale pair snapshot if mutations are still in flight. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-cascade-paths: cascade lookup only reads params->>'orchestrator_task_id_ref', missing shared reference paths and orchestrator-self detection. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-cascade-paths: duplicate of correctness-2 + correctness-3: invalid sql syntax and narrow cascade lookup. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-cascade-paths: shared orchestrator-reference helpers not referenced. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-cascade-paths: orchestrator tasks that crash don't get orchestrator-self cascade. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-cascade-paths: hardcoded params->>'orchestrator_task_id_ref' misses other reference paths. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-retry: crash requeue sql does not increment attempts, risking infinite requeue loop. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-retry: duplicate of correctness-1: attempts never advance on crash requeue. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-retry: missing attempts increment location in heartbeat sql. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-retry: step 6 under-scoped for real retry convergence and orchestrator-self handling. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-sql-syntax: bare select inside plpgsql is invalid — needs perform. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-testing: no multi-crash convergence test exercising attempts 0→1→2→3. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-testing: no validation that plpgsql body executes successfully. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-testing: criteria don't require proof of crash requeue convergence. (flagged 1 times across 1 plans)
[DEBT] criteria-verifiability: 'no unsafe .maybesingle()' criterion requires judgment about column uniqueness. (flagged 1 times across 1 plans)
[DEBT] criteria-verifiability: decision documentation location not specified. (flagged 1 times across 1 plans)
[DEBT] criteria-verifiability: the must criterion requiring 5 task types to exist as active db rows is not verifiable from code diff alone — it requires a live db query. (flagged 1 times across 1 plans)
[DEBT] db-fallback-testing: no new automated test for the db fallback dispatch path or dependant_on preservation for raw worker families. (flagged 1 times across 1 plans)
[DEBT] dependency-resolution: dependency resolution: the plan does not lock down the active python-version matrix even though the repo currently splits between python 3.10 local installs and a python 3.11 runpod image. (flagged 1 times across 1 plans)
[DEBT] did-the-work-fully-address-the-issue-hints-user-notes-and-approved-plan-requirements: did the work fully address the issue hints, user notes, and approved plan requirements?: the package is internally inconsistent. the plan body says to keep activepairdata in usestate and make phase 2 optional, but the attached metadata and success criteria still describe the previous derive-via-usememo / remove-setactivepairdata / simplify-onpairclick plan. that means the approved-plan requirements are only partially coherent as presented. (flagged 1 times across 1 plans)
[DEBT] did-the-work-fully-address-the-issue-hints-user-notes-and-approved-plan-requirements: did the work fully address the issue hints, user notes, and approved plan requirements?: the linux distro note is documentation-only; the generated install command in step 7 still runs apt-get install python3.10-venv python3.10-dev ffmpeg without any pre-check that the package exists. users on ubuntu 24.04+ who ignore the doc and try to copy-paste the command will hit a confusing e: unable to locate package python3.10-venv from apt rather than a targeted error from commandutils.ts. a one-line detection pre-check (e.g., apt-cache show python3.10-venv >/dev/null 2>&1 || { echo 'install deadsnakes ppa first — see readme'; exit 1; }) would convert the silent failure into an actionable error, but the plan does not add this. (flagged 1 times across 1 plans)
[DEBT] did-the-work-fully-address-the-issue-hints-user-notes-and-approved-plan-requirements: did the work fully address the issue hints, user notes, and approved plan requirements?: checked the revised v4 body against docs/wan2gp_fork_migration_plan.md sprint 2. the repo plan doc still lists an "ltx-2 self_refiner smoke against the pre-sprint behavioral baseline" as a sprint 2 verification gate and repeats that smoke in the functionality-preservation checks, but the revised execution steps no longer schedule that smoke anywhere; it survives only as an info-level metadata criterion. because wan2gp/shared/utils/self_refiner.py remains an explicit sprint 2 deliverable, the revised plan still only partially carries forward the verification package described in the source migration plan. (flagged 1 times across 1 plans)
[DEBT] does-the-change-touch-all-locations-and-supporting-infrastructure: does the change touch all locations and supporting infrastructure?: phase 1 still misses a real supporting-data location: trailingpairdata lives outside pairdatabyindex in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/tools/travel-between-images/components/shotimageseditor/hooks/usesegmentslotpresentationadapter.ts, but the proposed sync logic only considers pairdatabyindex. if trailing slot regenerate is part of the bug surface, that location is not covered. (flagged 1 times across 1 plans)
[DEBT] does-the-change-touch-all-locations-and-supporting-infrastructure: does the change touch all locations and supporting infrastructure?: the non-swallowing helper update_worker_phase_strict is a new shell function, but phase 1 step 2 introduces it only as pseudo-code. there is no concrete note that the helper must handle supabase http non-2xx responses as failures (curl returns 0 even on http 4xx/5xx by default unless -f or --fail-with-body is used). if the implementer ports update_worker_phase verbatim with only || return 0 removed, a 500 from supabase would still report success because curl's exit code is 0. the plan should specify curl --fail or explicit http status code checking in the strict variant. (flagged 1 times across 1 plans)
[DEBT] does-the-change-touch-all-locations-and-supporting-infrastructure: does the change touch all locations and supporting infrastructure?: the supporting-infrastructure review still finds one missing check. in docs/wan2gp_fork_migration_plan.md, sprint 2's verification matrix and risk register both single out self_refiner as a distinct drift-upgrade surface with its own smoke and its own silent-behavior-change risk, but the revised v4 body updates the file without keeping that supporting verification step in the actual execution checklist. (flagged 1 times across 1 plans)
[DEBT] edge-test-config: plan's vitest commands use the wrong config entry point. (flagged 1 times across 1 plans)
[DEBT] edge-test-config: same as verification-3: wrong vitest config in validation commands. (flagged 1 times across 1 plans)
[DEBT] edge-test-config: success criterion references wrong test command. (flagged 1 times across 1 plans)
[DEBT] error-handling: db loader error handling convention mismatch (plan says log+null, existing loaders throw) (flagged 1 times across 1 plans)
[DEBT] error-propagation-logging: generation.ts and handler.ts logging endpoints are not directly tested. (flagged 1 times across 1 plans)
[DEBT] error-propagation-testing: no end-to-end regression test for the full symptom chain (db error → tocompletionerror metadata → handler log). (flagged 1 times across 1 plans)
[DEBT] error-propagation-testing: handler.ts metadata surfacing criterion lacks a concrete automated verifier. (flagged 1 times across 1 plans)
[DEBT] error-propagation-testing: main issue only partially validated without an integration test. (flagged 1 times across 1 plans)
[DEBT] find-the-callers-of-the-changed-function-what-arguments-do-they-actually-pass-does-the-fix-handle-all-of-them: find the callers of the changed function. what arguments do they actually pass? does the fix handle all of them?: the step 2 retry loop uses a naked sleep 2 between attempts, which adds up to 6 seconds of latency on the happy path when the first patch eventually succeeds on attempt 2 or 3. for pods where supabase is reachable but slow during the initial moments of a cold runpod start, the retry logic is fine. however, if the first attempt fails with a tls handshake delay and the retry loop sleeps 2s per attempt regardless of whether curl itself has been blocking for tens of seconds, the total startup latency penalty could be substantial. this is a minor tuning concern, not a correctness issue. (flagged 1 times across 1 plans)
[DEBT] find-the-callers-of-the-changed-function-what-arguments-do-they-actually-pass-does-the-fix-handle-all-of-them: find the callers of the changed function. what arguments do they actually pass? does the fix handle all of them?: finding callers of the changed module shows that shared.utils.self_refiner is consumed by wan2gp/wgp.py, wan2gp/models/ltx2/ltx2_handler.py, multiple ltx2 pipeline modules, and wan2gp/models/wan/any2video.py. the revised validation steps still only drive the three bridge getters in source/runtime/wgp_ports/vendor_imports.py; none of the scheduled commands execute a real self_refiner caller, so the plan does not yet verify the main caller shapes for the other explicit sprint 2 file change. (flagged 1 times across 1 plans)
[DEBT] gpu-branching-test-matrix: linux cuda128 path under-verified (flagged 1 times across 1 plans)
[DEBT] gpu-branching-ui-surface: nvidia-50 option is exposed on linux in the ui but linux cuda128 smoke test is missing (flagged 1 times across 1 plans)
[DEBT] hook-abstraction: usepairsettingshandler becomes trivial with single caller — keeping it is extra indirection. (flagged 1 times across 1 plans)
[DEBT] is-the-change-in-the-right-place-and-would-it-break-any-callers: is the change in the right place, and would it break any callers?: the optional cleanup steps are not in the right place yet. pairregionslayer does not receive pairdatabyindex today; its props are only images, imagepositionswithpending, pairinfowithpending, and callback/display props in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/tools/travel-between-images/components/timeline/timelinecontainer/components/pairregionslayer.tsx. so step 4's 'pass pairdatabyindex.get(pairindex) directly' would require new prop plumbing or a different seam. (flagged 1 times across 1 plans)
[DEBT] is-the-scope-and-scale-of-the-change-appropriate: is the scope and scale of the change appropriate?: phase 2 is still under-specified for execution. step 4 says pairregionslayer should either pass pairdatabyindex.get(pairindex) directly or 'just pass the index + frame-only data', which are materially different designs. if phase 2 is kept in the plan, it needs a single concrete direction. (flagged 1 times across 1 plans)
[DEBT] is-there-convincing-verification-for-the-change: is there convincing verification for the change?: the plan still lacks an explicit automated regression test for the reported bug. step 2 is manual ('check that usevideoregeneratemode now gets the fresh url'), but there is no concrete test that opens a segment slot, changes the primary variant data, and asserts that the regenerate path sees the fresh url, generationid, and primaryvariantid. (flagged 1 times across 1 plans)
[DEBT] is-there-convincing-verification-for-the-change: is there convincing verification for the change?: the current usesegmentslotmode test remains only a smoke test in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/tools/travel-between-images/components/shotimageseditor/hooks/tests/usesegmentslotmode.test.ts, and the plan does not add behavior coverage for the new sync effect. (flagged 1 times across 1 plans)
[DEBT] is-there-convincing-verification-for-the-change: is there convincing verification for the change?: no verification step covers the trailing-slot branch, even though the proposed phase 1 logic currently misses trailingpairdata refreshes. (flagged 1 times across 1 plans)
[DEBT] legacy-data-backfill: the step 8 diagnostic query only detects cross-shot pair_shot_generation_id misassociations, not same-shot misassociations caused by timeline reordering within a shot. (flagged 1 times across 1 plans)
[DEBT] lookup-consistency: other repo call sites use unordered .limit(1).maybesingle() and will remain inconsistent. (flagged 1 times across 1 plans)
[DEBT] lookup-consistency: other call sites with same unsafe pattern not covered. (flagged 1 times across 1 plans)
[DEBT] lora-management: lora tools simplified vs full ui parity (multi-stage metadata, private loras) (flagged 1 times across 1 plans)
[DEBT] media-lightbox-persistence: variant switches do not clear/restore inpaintprompt, so stale prompt state can leak across variants with no cached prompt. (flagged 1 times across 1 plans)
[DEBT] media-lightbox-persistence: removing prompt/numgenerations from the variant-keyed localstorage cache means all variants within a generation share the same prompt. this broadens existing debt-002 (variant prompt leakage). (flagged 1 times across 1 plans)
[DEBT] media-lightbox-segment-slot: media lightbox / segment slot: the targeted sync rationale does not fully explain the reported stale-url bug for regular pairs, and the proposed effect still misses trailing-slot refreshes because those can come from trailingpairdata rather than pairdatabyindex. (flagged 1 times across 1 plans)
[DEBT] number-input-nullable: plan doesn't explicitly state onchange must also accept null, though step 3 depends on it. (flagged 1 times across 1 plans)
[DEBT] number-input-nullable: disputed v1 flag — original concern about bulkclippanel being unimplementable. (flagged 1 times across 1 plans)
[DEBT] number-input-nullable: onchange null filtering not explicitly addressed in plan. (flagged 1 times across 1 plans)
[DEBT] number-input-testing: no planned tests for numberinput shared component or bulkclippanel nullable draft flow. (flagged 1 times across 1 plans)
[DEBT] orchestrator-completion-rollout: pre-existing individual_travel_segment children won't drive orchestrator completion through segment_type_config after deploy. (flagged 1 times across 1 plans)
[DEBT] orchestrator-completion-rollout: missing compatibility seam in orchestratorcore.ts:123-126 for old individual_travel_segment rows. (flagged 1 times across 1 plans)
[DEBT] orchestrator-completion-rollout: mixed old/new data during rollout can leave old orchestrators without completion counting. (flagged 1 times across 1 plans)
[DEBT] orchestrator-completion-rollout: no test or deployment guard for pre-existing individual_travel_segment children completing after worker change. (flagged 1 times across 1 plans)
[DEBT] orchestrator-completion-rollout: plan overstates backward compatibility for existing data. (flagged 1 times across 1 plans)
[DEBT] orchestrator-completion-rollout: missing rollout compatibility step for in-flight individual_travel_segment tasks. (flagged 1 times across 1 plans)
[DEBT] orchestrator-completion-rollout: pre-deploy individual_travel_segment child completing post-rollout won't be treated as segment task by checkorchestratorcompletion. (flagged 1 times across 1 plans)
[DEBT] orchestrator-completion-rollout: orchestrator.test.ts criterion too narrow to verify old individual_travel_segment compatibility. (flagged 1 times across 1 plans)
[DEBT] pair-settings-plumbing: handleopenpairsettings(pairindex, pairframedata) path in timelinetrackprelude, segmentoutputstrip, and usesegmentoutputstrip not explicitly named. (flagged 1 times across 1 plans)
[DEBT] pair-settings-plumbing: same as flag-002 — segmentoutputstrip and usesegmentoutputstrip still carry pairframedata. (flagged 1 times across 1 plans)
[DEBT] pair-settings-plumbing: timelinetrackprelude and segmentoutputstrip still forward (pairindex, pairframedata). (flagged 1 times across 1 plans)
[DEBT] plan-scope: step 3 is larger than a light megaplan warrants. (flagged 1 times across 1 plans)
[DEBT] planning-metadata: planning metadata: the attached metadata and success criteria still describe a different implementation than the current plan body, which risks sending execution and review down the wrong path. (flagged 1 times across 1 plans)
[DEBT] planning-metadata: success criteria don't cover wave 4 scope (flagged 1 times across 1 plans)
[DEBT] position-key-semantics: plan investigates a unique constraint on (parent_generation_id, child_order) which doesn't match repo semantics for position keys. (flagged 1 times across 1 plans)
[DEBT] position-key-semantics: plan weights toward child_order rather than pair_shot_generation_id as the key that matters. (flagged 1 times across 1 plans)
[DEBT] position-key-semantics: unique constraint on (parent_generation_id, child_order) not supported by repo semantics. (flagged 1 times across 1 plans)
[DEBT] prompt-composition: the plan's step 1 signature includes textbeforeprompts/textafterprompts parameters that would be applied before enhancement, double-wrapping the prompt. (flagged 1 times across 1 plans)
[DEBT] ready-template-snapshots: step 4.2 drops markdownnote nodes but step 4.5 and the success criteria require class_type/widget parity with pre-refactor snapshots, which currently include markdownnote nodes. (flagged 1 times across 1 plans)
[DEBT] ready-template-snapshots: same tension as issue_hints v2: drop-markdownnote vs. snapshot parity. (flagged 1 times across 1 plans)
[DEBT] search-for-related-code-that-handles-the-same-concept-is-the-reported-issue-a-symptom-of-something-broader: search for related code that handles the same concept. is the reported issue a symptom of something broader?: checked the broader runtime surface after the v4 path fix. sprint 2 is still moving two behavior-sensitive seams rather than just the import-path contract: the wan2gp/ mount path and the self_refiner runtime. step 6.2 covers only the three vendor_imports getters, while the 6-file travel suite and the bridge-contract tests do not mention self_refiner, so dropping the dedicated self-refiner smoke from the runnable steps leaves the broader downstream surface of that changed file under-covered. (flagged 1 times across 1 plans)
[DEBT] self-refiner-verification: self-refiner verification: the revised plan still aligns wan2gp/shared/utils/self_refiner.py without scheduling the sprint 2 ltx-2 self_refiner smoke that docs/wan2gp_fork_migration_plan.md defines as the behavior-preservation check for that drift upgrade. (flagged 1 times across 1 plans)
[DEBT] settings-defaults: workerrepopath default can go stale if user switches computertype before editing path (flagged 1 times across 1 plans)
[DEBT] settings-resolution: settings cascade missing — shot-only read diverges from form's defaults→user→project→shot merge (flagged 1 times across 1 plans)
[DEBT] settings-resolution: settings cascade missing — shot-only read (flagged 1 times across 1 plans)
[DEBT] shared-component-compatibility: numberinput changes affect callers outside video-editor (billing, travel-between-images, phaseconfigselectormodal). (flagged 1 times across 1 plans)
[DEBT] shared-component-compatibility: shared ui component blast radius not audited in plan. (flagged 1 times across 1 plans)
[DEBT] shot-linking-testing: no test covers the linkgenerationtoshot error/catch branches. (flagged 1 times across 1 plans)
[DEBT] signature-propagation: plan doesn't explicitly name timeline/index.tsx and segmentslotcontracts.ts for updates. (flagged 1 times across 1 plans)
[DEBT] signature-propagation: same as flag-001 — timeline/index.tsx and segmentslotcontracts.ts not in checklist. (flagged 1 times across 1 plans)
[DEBT] signature-propagation: five supporting contract/plumbing sites not named in the checklist. (flagged 1 times across 1 plans)
[DEBT] task-types-verification: step 3 cites wrong migration file (task_cost_configs instead of task_types) as evidence for db fallback path. (flagged 1 times across 1 plans)
[DEBT] task-types-verification: step 3 should cite task_types source, not task_cost_configs. (flagged 1 times across 1 plans)
[DEBT] task-types-verification: plan doesn't verify travel_segment and travel_stitch exist as active task_types rows using the correct table. (flagged 1 times across 1 plans)
[DEBT] test-coverage: current generation-child.test.ts is only a smoke test. (flagged 1 times across 1 plans)
[DEBT] test-coverage: no plan to verify other lookup paths choose rows consistently. (flagged 1 times across 1 plans)
[DEBT] test-coverage: no new tests for db loader or travel param merge path (flagged 1 times across 1 plans)
[DEBT] test-coverage: must-level criteria depend on manual testing rather than automated assertions (flagged 1 times across 1 plans)
[DEBT] test-coverage: no new unit tests for wave 4 tools (flagged 1 times across 1 plans)
[DEBT] test-coverage: must criteria backed by manual testing only (flagged 1 times across 1 plans)
[DEBT] test-infrastructure: no test fixtures for resources table (flagged 1 times across 1 plans)
[DEBT] timeline-drag-coordination: plan keeps two hooks instead of a single coordinator (flagged 1 times across 1 plans)
[DEBT] timeline-drag-coordination: brief says single coordinator but plan keeps separate hooks (flagged 2 times across 1 plans)
[DEBT] timeline-drag-coordination: pendingopsref retained despite brief suggesting removal (flagged 1 times across 1 plans)
[DEBT] timeline-drag-coordination: wrapper-bound listener mount wiring under-specified (flagged 1 times across 1 plans)
[DEBT] timeline-persistence: read path still assembles config and registry from separate requests (flagged 1 times across 1 plans)
[DEBT] timeline-persistence: poll sync verification not structurally changed (flagged 1 times across 1 plans)
[DEBT] timeline-persistence: backend save helpers not wired to new rpc (flagged 1 times across 1 plans)
[DEBT] timeline-persistence: read infrastructure not updated (flagged 1 times across 1 plans)
[DEBT] timeline-persistence: backend tests not in validation list (flagged 1 times across 1 plans)
[DEBT] timeline-persistence: backend callers not migrated (flagged 1 times across 1 plans)
[DEBT] timeline-persistence: broader persistence-contract problem (flagged 1 times across 1 plans)
[DEBT] timeline-persistence: backend split-save not addressed (flagged 1 times across 1 plans)
[DEBT] timeline-persistence: split polling can combine config and registry from different snapshots (flagged 1 times across 1 plans)
[DEBT] timeline-scaling: the plan only specifies a concrete fix for the default scale(1) case; explicit-scale tracks may still break blend-mode effects. (flagged 1 times across 1 plans)
[DEBT] timeline-snap-threshold: threshold is generous (duration) rather than zoom-scaled (8px) (flagged 1 times across 1 plans)
[DEBT] timeline-snap-threshold: computedropposition does not pass a zoom-scaled threshold override (flagged 1 times across 1 plans)
[DEBT] travel-continuations: smooth continuations not threaded — agent tasks won't have continuation_config even when shot settings enable it (flagged 1 times across 1 plans)
[DEBT] travel-continuations: continuation_config omitted from form parity (flagged 1 times across 1 plans)
[DEBT] travel-payload-cleanup-scope: plan scope narrower than original user request (flagged 1 times across 1 plans)
[DEBT] travel-payload-cleanup-scope: broader create-task contract problem left untouched (flagged 1 times across 1 plans)
[DEBT] travel-payload-readers: phase 4 app-side reader audit incomplete (flagged 1 times across 1 plans)
[DEBT] travel-payload-readers: phase 4 field inventory incomplete for app-side readers (flagged 1 times across 1 plans)
[DEBT] travel-request-contract: image_variant_ids is in frontend request contract (flagged 1 times across 1 plans)
[DEBT] travel-request-contract: image_variant_ids contract change (flagged 1 times across 1 plans)
[DEBT] variant-update-b-fresh-takeover: spawn_worker does not internally call start_worker_process; harness must call both explicitly (flagged 1 times across 1 plans)
[DEBT] variant-update-b-fresh-takeover: worker_id and runpod_id must be generated and threaded distinctly; plan currently uses pod_id as both (flagged 1 times across 1 plans)
[DEBT] variant-update-b-fresh-takeover: duplicate of correctness-1 — spawn_worker two-step misstatement (flagged 2 times across 1 plans)
[DEBT] variant-update-b-fresh-takeover: duplicate of correctness-2 — worker_id/runpod_id propagation across takeover and restore paths (flagged 1 times across 1 plans)
[DEBT] variant-update-b-fresh-takeover: duplicate of correctness-1 + correctness-2 — missing create_worker_record glue and start_worker_process integration (flagged 1 times across 1 plans)
[DEBT] variant-update-b-fresh-takeover: duplicate of correctness-2 — caller contract for spawn_worker requires worker_id, not pod_id (flagged 1 times across 1 plans)
[DEBT] verification: no end-to-end render test for audio analysis timing (flagged 1 times across 1 plans)
[DEBT] verification: no automated coverage for text clips or overlapping clips with audio effects (flagged 1 times across 1 plans)
[DEBT] verification-coverage: no automated test exercises the full segment-slot opening path after cleanup. (flagged 1 times across 1 plans)
[DEBT] verification-coverage: no automated coverage that clicking a pair opens the correct modal after cleanup. (flagged 1 times across 1 plans)
[DEBT] verification-coverage: zero behavioral change criterion is not verifiable from tsc + existing tests alone. (flagged 1 times across 1 plans)
[DEBT] verification-workflow: tsconfig.app.json excludes test files, so tsc won't catch test breakage. (flagged 1 times across 1 plans)
[DEBT] worker-test-staleness: worker test in test_additional_coverage_modules.py:37 may assert stale payload structure (task_type vs family). (flagged 1 times across 1 plans)
code
Note: User chose auto-approve mode. This execution was not manually reviewed at the gate. Exercise extra caution on destructive operations.
Robustness level: standard.
Requirements:
- Execute only the actionable tasks in this batch.
- Treat completed tasks as dependency context, not new work.
- Return structured JSON only.
- Only produce `task_updates` for these tasks: [T1]
- Only produce `sense_check_acknowledgments` for these sense checks: [SC1, SC2]
- Do not include updates for tasks or sense checks outside this batch.
- Keep `executor_notes` verification-focused.
- Best-effort progress checkpointing: if `/Users/user_c042661f/Documents/reigh-workspace/vibecomfy/.megaplan/plans/vibecomfy-warm-runtime-20260425-1936/execution_batch_1.json` is writable, checkpoint task and sense-check updates there (not `finalize.json`). The harness owns `finalize.json`.
- When verifying changes, run the entire test file or module, not individual test functions. Individual tests miss regressions.
- finalize.json includes baseline_test_failures — a list of test IDs that were already failing before your changes. If a test fails and its ID appears in baseline_test_failures, it is pre-existing — do not scope-creep into fixing it. If baseline_test_failures is null, the baseline could not be captured; use your judgment but err on the side of assuming failures are regressions. You MUST still re-run the FULL test suite with your changes applied — pre-existing failures do not excuse skipping verification. Never narrow to individual test functions and stop.
- If this batch includes the final verification task, write a short script that reproduces the exact bug described in the task, run it to confirm the fix resolves it, then delete the script.
{"output":"Batch 1 complete. T1 implemented and verified. python -m pytest tests/test_runtime_run.py passed, and the full suite passed with 87 passed, 1 skipped. Checkpoint written to .megaplan/plans/vibecomfy-warm-runtime-20260425-1936/execution_batch_1.json.","files_changed":["vibecomfy/runtime/session.py","vibecomfy/runtime/run.py",".megaplan/plans/vibecomfy-warm-runtime-20260425-1936/execution_batch_1.json"],"commands_run":["python -m compileall vibecomfy/runtime/session.py vibecomfy/runtime/run.py","python - <<'PY'\nfrom vibecomfy.runtime.session import _partition_comfy_config\ncases = [\n {'port': 8200, 'reserve_vram': 12, 'fp8_e4m3fn_text_enc': True},\n {'reserve_vram_gb': 2.0, 'reserve_vram': 12},\n {'cache_none': True, 'cache_lru': 3, 'cache_policy': 'classic'},\n]\nfor case in cases:\n print(case, '->', _partition_comfy_config(case))\nPY","python -c 'import vibecomfy.runtime.session; import vibecomfy.runtime.run; from vibecomfy.runtime import RunResult; print(RunResult.name)'","pytest tests/test_runtime_run.py","python -m pytest tests/test_runtime_run.py","python -m pytest"],"deviations":["Bare pytest tests/test_runtime_run.py failed during collection with ModuleNotFoundError: No module named 'vibecomfy'; reran the same full test module with python -m pytest tests/test_runtime_run.py, which passed. Full python -m pytest also passed.","vibecomfy/runtime/__init__.py already re-exported RunResult through run.py; no edit was needed after preserving that import path."],"task_updates":[{"task_id":"T1","status":"done","executor_notes":"Created runtime/session.py with SessionConfig, VibeSession Protocol, EmbeddedSession, _embedded_configuration_for_session, _embedded_configuration workflow wrapper, model_fingerprint, and relocated RunResult/_prepare_prompt/_run_metadata/_collect_output_paths/_git_sha. Updated runtime/run.py to import relocated helpers from session.py and keep _embedded_configuration resolvable from runtime.run. Verified no reverse import from session.py to run.py, import check passed, partition conflict spot checks passed, python -m pytest tests/test_runtime_run.py passed, and full python -m pytest passed.","files_changed":["vibecomfy/runtime/session.py","vibecomfy/runtime/run.py"],"commands_run":["python -m compileall vibecomfy/runtime/session.py vibecomfy/runtime/run.py","python -c 'import vibecomfy.runtime.session; import vibecomfy.runtime.run; from vibecomfy.runtime import RunResult; print(RunResult.name)'","python -m pytest tests/test_runtime_run.py","python -m pytest"],"auto_attributed_files":true}],"sense_check_acknowledgments":[{"sense_check_id":"SC1","executor_note":"Confirmed session.py contains VibeSession Protocol, SessionConfig with extra, EmbeddedSession, _embedded_configuration_for_session, _embedded_configuration, model_fingerprint, and relocated RunResult/_prepare_prompt/_run_metadata/_collect_output_paths/_git_sha. run.py imports from session.py, session.py does not import run.py, and from vibecomfy.runtime import RunResult works."},{"sense_check_id":"SC2","executor_note":"Confirmed _partition_comfy_config accepts typed names and raw HiddenSwitch keys in the same dict. The implementation documents and applies HS-translated keys first, then typed-name overwrite; spot checks covered mixed input and {reserve_vram_gb: 2.0, reserve_vram: 12} resolving to reserve_vram_gb == 2.0."}]}
Today both vibecomfy runtime paths are cold-per-call:
Embedded: vibecomfy/runtime/run.py:125-138 enters/exits a fresh Comfy() context per run. The exit calls embedded_comfy_client.py:_cleanup -> model_management.unload_all_models() + gc + soft_empty_cache. Models are dumped after every generation.
Managed server: vibecomfy/runtime/server.py:16 starts comfyui as a subprocess, queues once, terminates. Same outcome at the process level.
ComfyUI itself already keeps models warm by default — current_loaded_models persists in process, load_models_gpu reuses resident copies, eviction is pressure-driven, OOM is auto-handled (execution.py:735-737), and DISABLE_SMART_MEMORY is the only thing that forces unload after each prompt. So the work is structural: stop tearing the runtime down.
Goal
Add session-aware warm runtime to vibecomfy with two backends sharing one abstraction:
Long-lived managed Comfy server (HTTP control plane) — default for CLI users.
Default policy: keep warm. Explicit flush available. Auto-flush on detected model-set change under VRAM pressure.
Verified facts (don't re-research)
POST /free and POST /api/free both exist in the embedded hiddenswitch fork at comfy/cmd/server.py:1041 with /api mirror auto-added at :1357. Payload: {"unload_models": bool, "free_memory": bool}. They set queue flags via prompt_queue.set_flag(...) — async, take effect at next prompt boundary, not synchronously.
CLI flags exist in comfy/cli_args.py:115-160: --highvram, --lowvram, --normalvram, --reserve-vram , --disable-smart-memory, --cache-classic, --cache-lru N, --cache-none.
Comfy.clear_cache() (embedded_comfy_client.py:385) and Comfy.reconfigure() (:398) already exposed; reconfigure uses MODEL_MANAGEMENT_ARGS fingerprint to avoid unnecessary subprocess cycling.
The cleanup that nukes warm state lives in embedded_comfy_client.py:_cleanup (lines ~149-169) and is called from Comfy.aexit (line ~481).
Design constraints / refinements over the user's notes
Do NOT default to --highvram (breaks multi-model workflows that need offload). Default to Comfy's smart memory.
/free is asynchronous — flush API must either drain via a no-op prompt or document the queue-flag semantics. Tests must account for this.
Auto-flush should only trigger on model-set fingerprint change AND VRAM-headroom-below-threshold. Input/seed/prompt changes must NOT trigger flush.
Session lifecycle: daemon-style for CLI (pidfile + URL file under out/sessions//) so multiple vibecomfy run invocations share one warm pool. Embedded session is just a Python context manager.
Browser-only tasks: there are none in this plan (no UI work).
No hard-halt prereq clauses: each milestone is independently shippable.
Out of scope for this megaplan
Multi-GPU session pooling.
Distributed/remote session sharing across machines.
Workflow-graph-level caching (Comfy already has --cache-lru / --cache-classic).
Replacing the existing one-shot run/run_embedded APIs — they should remain as thin wrappers around the new session.
Cloud/RunPod orchestration changes (the runpod worker can adopt EmbeddedSession in a separate plan).
Suggested milestone shape (megaplan can refine during prep/plan)
M1: Session abstraction + embedded backend
vibecomfy/runtime/session.py: VibeSession protocol + EmbeddedSession holding a long-lived Comfy() across multiple .run(workflow) calls.
Refactor run_embedded() to be a one-shot wrapper around EmbeddedSession.
Tests: two sequential runs in one session reuse models (assert via inspecting comfy.model_management.current_loaded_models after each run, or via a stub model manager); flush() drops them; reconfigure with same fingerprint is a no-op.
M2: Managed server backend
ServerSession: keeps comfy_server subprocess alive across .run() calls. Start = spawn + wait-ready. .flush() = POST /api/free with appropriate flags. .stop() = SIGTERM with timeout fallback to SIGKILL.
vibecomfy run auto-discovers active session if one exists, else falls back to one-shot managed mode.
Tests: session start/stop, flush via HTTP, two runs share warmth, daemon survives across CLI invocations.
M3: Auto-flush policy + fingerprinting
vibecomfy/runtime/model_fingerprint.py: extract loader-node identity tuples from a workflow (CheckpointLoaderSimple.ckpt_name, LoraLoader.lora_name, UNETLoader.unet_name, VAELoader.vae_name, CLIPLoader.clip_name, DualCLIPLoader, etc. — discover the canonical set from the embedded fork's nodes).
Session.run() compares current workflow fingerprint to last-run fingerprint. If different AND free VRAM < threshold (configurable, default e.g. 2GB), call flush() before queueing.
VIBECOMFY_WARM env var: auto (default) | always | never.
Tests: same model + different seed -> no flush; different ckpt -> flush; auto-flush gated by VRAM headroom (mock get_free_memory).
Smoke test: vibecomfy session start && vibecomfy run x.json && vibecomfy run y.json && vibecomfy session stop — second run is materially faster than first (timing-based, with tolerance).
Open questions for the planning step
Should vibecomfy run lazily start a session on first call and reuse it (implicit warm) vs always require session start? Lean toward explicit start for predictability.
Does the runpod worker (reigh-workspace/reigh-worker) want to consume EmbeddedSession directly or talk to a local managed session? Probably embedded — it owns the process lifecycle already. Out of scope for this plan, but the API should not preclude it.
Do we need partial flush (just CLIP, just VAE, just UNet)? Probably no — Comfy's pressure-driven eviction handles per-model decisions; only expose all-or-nothing flush at the session boundary.
Success criteria (suggested — planning phase should refine)
A VibeSession abstraction exists with both Embedded and Server backends.
Two sequential .run() calls in one session share warm models (verified by test, not just timing).
flush() is explicit and works for both backends. For the server backend, the test accounts for /free's queue-flag semantics.
vibecomfy session start/stop/list/flush CLI commands exist and survive across separate vibecomfy invocations.
Auto-flush policy fires on model-set change under VRAM pressure, never on seed/input changes.
Existing run and run_embedded one-shot APIs continue to work unchanged (backwards compatibility).
Documentation updated in docs/runtime_lifecycle.md and docs/runtime_surface.md.
User notes and answers:
FLAG-012 fix: _partition_comfy_config must accept both typed SessionConfig field names and raw HiddenSwitch keys. Treat typed names (port, vram_policy, cache_policy, warm_policy, reserve_vram_gb) as direct routes to typed dataclass fields. Treat raw HS keys (reserve_vram, cache_none, --highvram, etc.) via the existing HiddenSwitch translation path. Unknown keys go to extra. Tests in Step 7.3 expect typed-name daemon config carry-through; tests for the embedded path may also feed raw HS keys.
code
Batch framing:
- Execute batch 2 of 7.
- Actionable task IDs for this batch: ['T2']
- Already completed task IDs available as dependency context: ['T1']
Actionable tasks for this batch:
[
{
"id": "T2",
"description": "Add the auto-flush gate inside EmbeddedSession.run in session.py. Before queueing: compute fp = model_fingerprint(api_dict). Resolve effective warm policy: os.environ.get('VIBECOMFY_WARM') overrides config.warm_policy. Behavior: 'never' \u2192 flush() then queue; 'always' \u2192 never auto-flush; 'auto' \u2192 flush iff last_fingerprint is not None and fp != last_fingerprint and _free_vram_gb() < config.auto_flush_vram_threshold_gb. After successful queue: self.last_fingerprint = fp. Add _free_vram_gb() helper that lazily imports comfy.model_management.get_free_memory() and returns float('inf') on any ImportError/AttributeError so missing GPU/torch doesn't break the gate.",
"depends_on": [
"T1"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
}
]
code
Completed task context (already satisfied, do not re-execute unless directly required by current edits):
[
{
"id": "T1",
"description": "Create vibecomfy/runtime/session.py and relocate shared runtime helpers from run.py. Move RunResult (run.py:19-25), _prepare_prompt (run.py:28-42), _run_metadata (run.py:76-96), _collect_output_paths (run.py:204-215), _git_sha (run.py:99-109), and the body of _embedded_configuration (run.py:163-181) into session.py \u2014 run.py imports from session.py, never the reverse. Update vibecomfy/runtime/init.py:1-11 so from vibecomfy.runtime import RunResult keeps working (re-export through run.py). Define: (a) SessionConfig dataclass with fields vram_policy/reserve_vram_gb/cache_policy/disable_smart_memory/warm_policy/auto_flush_vram_threshold_gb/port/extra. (b) Private _partition_comfy_config(d) that splits a dict into typed-field kwargs vs extra \u2014 accepts BOTH typed SessionConfig field names AND raw HiddenSwitch keys per the FLAG-012 mapping table (typed names port/vram_policy/cache_policy/warm_policy/reserve_vram_gb/disable_smart_memory/auto_flush_vram_threshold_gb route directly; raw HS keys reserve_vram\u2192reserve_vram_gb, highvram/lowvram/normalvram\u2192vram_policy, cache_none/cache_classic/cache_lru\u2192cache_policy; unknown\u2192extra). Conflict precedence: apply HS-translated keys first, then typed-name keys overwrite. (c) and (delegates to from_dict on workflow.metadata.get('comfy_configuration', {})). (d) with start/run/flush/reconfigure/stop and last_fingerprint attr. (e) holding one long-lived Comfy() across calls (start instantiates Comfy with _embedded_configuration_for_session, queue_prompt_api in run, clear_cache in flush, reconfigure passes a new Configuration, stop tolerates model_mmap_residency AttributeError). (f) (apply order: typed fields \u2192 config.extra \u2192 VIBECOMFY_COMFY_CONFIGURATION env override; returns None if merged dict empty matching run.py:174-175). (g) thin wrapper around _embedded_configuration_for_session(SessionConfig.from_workflow_metadata(workflow)) \u2014 preserves existing public signature. (h) Pattern-based \u2014 any class_type containing 'Loader' (and not in OVERRIDES_EXCLUDE), plus members of OVERRIDES_INCLUDE, contributes its non-edge string-valued input slots as sorted (class_type, slot, value) triples; OVERRIDES sets start empty.",
"depends_on": [],
"status": "done",
"executor_notes": "Created runtime/session.py with SessionConfig, VibeSession Protocol, EmbeddedSession, _embedded_configuration_for_session, _embedded_configuration workflow wrapper, model_fingerprint, and relocated RunResult/_prepare_prompt/_run_metadata/_collect_output_paths/_git_sha. Updated runtime/run.py to import relocated helpers from session.py and keep _embedded_configuration resolvable from runtime.run. Verified no reverse import from session.py to run.py, import check passed, partition conflict spot checks passed, python -m pytest tests/test_runtime_run.py passed, and full python -m pytest passed.",
"files_changed": [
"vibecomfy/runtime/session.py",
"vibecomfy/runtime/run.py"
],
"commands_run": [
"python -m compileall vibecomfy/runtime/session.py vibecomfy/runtime/run.py",
"python -c 'import vibecomfy.runtime.session; import vibecomfy.runtime.run; from vibecomfy.runtime import RunResult; print(RunResult.)'",
"python -m pytest tests/test_runtime_run.py",
"python -m pytest"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
}
]
Today both vibecomfy runtime paths are cold-per-call:
Embedded: vibecomfy/runtime/run.py:125-138 enters/exits a fresh Comfy() context per run. The exit calls embedded_comfy_client.py:_cleanup -> model_management.unload_all_models() + gc + soft_empty_cache. Models are dumped after every generation.
Managed server: vibecomfy/runtime/server.py:16 starts comfyui as a subprocess, queues once, terminates. Same outcome at the process level.
ComfyUI itself already keeps models warm by default — current_loaded_models persists in process, load_models_gpu reuses resident copies, eviction is pressure-driven, OOM is auto-handled (execution.py:735-737), and DISABLE_SMART_MEMORY is the only thing that forces unload after each prompt. So the work is structural: stop tearing the runtime down.
Goal
Add session-aware warm runtime to vibecomfy with two backends sharing one abstraction:
Long-lived managed Comfy server (HTTP control plane) — default for CLI users.
Default policy: keep warm. Explicit flush available. Auto-flush on detected model-set change under VRAM pressure.
Verified facts (don't re-research)
POST /free and POST /api/free both exist in the embedded hiddenswitch fork at comfy/cmd/server.py:1041 with /api mirror auto-added at :1357. Payload: {"unload_models": bool, "free_memory": bool}. They set queue flags via prompt_queue.set_flag(...) — async, take effect at next prompt boundary, not synchronously.
CLI flags exist in comfy/cli_args.py:115-160: --highvram, --lowvram, --normalvram, --reserve-vram , --disable-smart-memory, --cache-classic, --cache-lru N, --cache-none.
Comfy.clear_cache() (embedded_comfy_client.py:385) and Comfy.reconfigure() (:398) already exposed; reconfigure uses MODEL_MANAGEMENT_ARGS fingerprint to avoid unnecessary subprocess cycling.
The cleanup that nukes warm state lives in embedded_comfy_client.py:_cleanup (lines ~149-169) and is called from Comfy.aexit (line ~481).
Design constraints / refinements over the user's notes
Do NOT default to --highvram (breaks multi-model workflows that need offload). Default to Comfy's smart memory.
/free is asynchronous — flush API must either drain via a no-op prompt or document the queue-flag semantics. Tests must account for this.
Auto-flush should only trigger on model-set fingerprint change AND VRAM-headroom-below-threshold. Input/seed/prompt changes must NOT trigger flush.
Session lifecycle: daemon-style for CLI (pidfile + URL file under out/sessions//) so multiple vibecomfy run invocations share one warm pool. Embedded session is just a Python context manager.
Browser-only tasks: there are none in this plan (no UI work).
No hard-halt prereq clauses: each milestone is independently shippable.
Out of scope for this megaplan
Multi-GPU session pooling.
Distributed/remote session sharing across machines.
Workflow-graph-level caching (Comfy already has --cache-lru / --cache-classic).
Replacing the existing one-shot run/run_embedded APIs — they should remain as thin wrappers around the new session.
Cloud/RunPod orchestration changes (the runpod worker can adopt EmbeddedSession in a separate plan).
Suggested milestone shape (megaplan can refine during prep/plan)
M1: Session abstraction + embedded backend
vibecomfy/runtime/session.py: VibeSession protocol + EmbeddedSession holding a long-lived Comfy() across multiple .run(workflow) calls.
Refactor run_embedded() to be a one-shot wrapper around EmbeddedSession.
Tests: two sequential runs in one session reuse models (assert via inspecting comfy.model_management.current_loaded_models after each run, or via a stub model manager); flush() drops them; reconfigure with same fingerprint is a no-op.
M2: Managed server backend
ServerSession: keeps comfy_server subprocess alive across .run() calls. Start = spawn + wait-ready. .flush() = POST /api/free with appropriate flags. .stop() = SIGTERM with timeout fallback to SIGKILL.
vibecomfy run auto-discovers active session if one exists, else falls back to one-shot managed mode.
Tests: session start/stop, flush via HTTP, two runs share warmth, daemon survives across CLI invocations.
M3: Auto-flush policy + fingerprinting
vibecomfy/runtime/model_fingerprint.py: extract loader-node identity tuples from a workflow (CheckpointLoaderSimple.ckpt_name, LoraLoader.lora_name, UNETLoader.unet_name, VAELoader.vae_name, CLIPLoader.clip_name, DualCLIPLoader, etc. — discover the canonical set from the embedded fork's nodes).
Session.run() compares current workflow fingerprint to last-run fingerprint. If different AND free VRAM < threshold (configurable, default e.g. 2GB), call flush() before queueing.
VIBECOMFY_WARM env var: auto (default) | always | never.
Tests: same model + different seed -> no flush; different ckpt -> flush; auto-flush gated by VRAM headroom (mock get_free_memory).
Smoke test: vibecomfy session start && vibecomfy run x.json && vibecomfy run y.json && vibecomfy session stop — second run is materially faster than first (timing-based, with tolerance).
Open questions for the planning step
Should vibecomfy run lazily start a session on first call and reuse it (implicit warm) vs always require session start? Lean toward explicit start for predictability.
Does the runpod worker (reigh-workspace/reigh-worker) want to consume EmbeddedSession directly or talk to a local managed session? Probably embedded — it owns the process lifecycle already. Out of scope for this plan, but the API should not preclude it.
Do we need partial flush (just CLIP, just VAE, just UNet)? Probably no — Comfy's pressure-driven eviction handles per-model decisions; only expose all-or-nothing flush at the session boundary.
Success criteria (suggested — planning phase should refine)
A VibeSession abstraction exists with both Embedded and Server backends.
Two sequential .run() calls in one session share warm models (verified by test, not just timing).
flush() is explicit and works for both backends. For the server backend, the test accounts for /free's queue-flag semantics.
vibecomfy session start/stop/list/flush CLI commands exist and survive across separate vibecomfy invocations.
Auto-flush policy fires on model-set change under VRAM pressure, never on seed/input changes.
Existing run and run_embedded one-shot APIs continue to work unchanged (backwards compatibility).
Documentation updated in docs/runtime_lifecycle.md and docs/runtime_surface.md.
User notes and answers:
FLAG-012 fix: _partition_comfy_config must accept both typed SessionConfig field names and raw HiddenSwitch keys. Treat typed names (port, vram_policy, cache_policy, warm_policy, reserve_vram_gb) as direct routes to typed dataclass fields. Treat raw HS keys (reserve_vram, cache_none, --highvram, etc.) via the existing HiddenSwitch translation path. Unknown keys go to extra. Tests in Step 7.3 expect typed-name daemon config carry-through; tests for the embedded path may also feed raw HS keys.
code
Batch framing:
- Execute batch 3 of 7.
- Actionable task IDs for this batch: ['T3', 'T5']
- Already completed task IDs available as dependency context: ['T1', 'T2']
Actionable tasks for this batch:
[
{
"id": "T3",
"description": "Refactor run_embedded() in vibecomfy/runtime/run.py:116-156 to be a thin wrapper around EmbeddedSession.start()/run()/stop(). Public signatures of run_embedded and run_embedded_sync MUST remain unchanged. Delete the relocated helper bodies from run.py and import them from session.py. Re-export _embedded_configuration from run.py so from vibecomfy.runtime.run import _embedded_configuration continues to resolve (commands/doctor.py:56 and tests/test_runtime_run.py:116 depend on this). Verify vibecomfy/commands/doctor.py:56-60 still works without modification (it passes a VibeWorkflow, which routes through the wrapper).",
"depends_on": [
"T1",
"T2"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T5",
"description": "Add ServerSession backend in session.py. Extract subprocess startup from runtime/server.py:27-41 into _spawn_comfy_server(config: SessionConfig) -> tuple[Process, str, log_handle] in session.py. Translate SessionConfig to CLI flags: --highvram|--lowvram|--normalvram (skip when 'auto'), --reserve-vram <GB>, --disable-smart-memory, --cache-classic|--cache-lru N|--cache-none (skip when 'smart'), --port <P>. Reuse the 120-iteration /system_stats readiness loop. Add class ServerSession(VibeSession): start() calls _spawn_comfy_server; run() calls ComfyClient(self.url).queue_prompt(api_dict) wrapped by the same auto-flush gate from T2; flush() POSTs /api/free with {unload_models: True, free_memory: True}; reconfigure(config) is restart-on-change (compare CLI argv); stop() SIGTERM with 15s timeout fallback to SIGKILL. Add ComfyClient.free(unload_models, free_memory) in runtime/client.py:30+ with a one-line docstring noting queue-async semantics.",
"depends_on": [
"T1",
"T2"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
}
]
Not yet included in a published release.
last_fingerprint is not None and fp != last_fingerprint and _free_vram_gb() < config.auto_flush_vram_threshold_gb
_free_vram_gb()
comfy.model_management.get_free_memory()
from vibecomfy.runtime.run import _embedded_configuration
"Bare pytest tests/test_runtime_run.py failed during collection with ModuleNotFoundError: No module named 'vibecomfy'; reran the same full test module with python -m pytest tests/test_runtime_run.py, which passed. Full python -m pytest also passed.",
"vibecomfy/runtime/__init__.py already re-exported RunResult through run.py; no edit was needed after preserving that import path.",
"Advisory quality: skipped quality checks because post-batch git snapshot failed: Project directory is not a git repository.",
"Advisory observation skip before batch 1/7: Project directory is not a git repository.",
"Advisory observation skip after batch 1/7: Project directory is not a git repository.",
"Advisory audit skip: Project directory is not a git repository."
]
code
Batch-scoped sense checks:
[
{
"id": "SC3",
"task_id": "T2",
"question": "Does the auto-flush gate honor VIBECOMFY_WARM (never\u2192pre-flush, always\u2192never auto-flush, auto\u2192fingerprint-change-and-low-VRAM), and does _free_vram_gb return float('inf') on import failure rather than crashing?",
"executor_note": "Trace EmbeddedSession.run with each VIBECOMFY_WARM value mocked. Independently call _free_vram_gb in an environment without comfy.model_management to confirm float('inf') return.",
"verdict": ""
}
]
code
Full execution tracking source of truth (`finalize.json`):
{
"tasks": [
{
"id": "T1",
"description": "Create vibecomfy/runtime/session.py and relocate shared runtime helpers from run.py. Move RunResult (run.py:19-25), _prepare_prompt (run.py:28-42), _run_metadata (run.py:76-96), _collect_output_paths (run.py:204-215), _git_sha (run.py:99-109), and the body of _embedded_configuration (run.py:163-181) into session.py \u2014 run.py imports from session.py, never the reverse. Update vibecomfy/runtime/init.py:1-11 so from vibecomfy.runtime import RunResult keeps working (re-export through run.py). Define: (a) SessionConfig dataclass with fields vram_policy/reserve_vram_gb/cache_policy/disable_smart_memory/warm_policy/auto_flush_vram_threshold_gb/port/extra. (b) Private _partition_comfy_config(d) that splits a dict into typed-field kwargs vs extra \u2014 accepts BOTH typed SessionConfig field names AND raw HiddenSwitch keys per the FLAG-012 mapping table (typed names port/vram_policy/cache_policy/warm_policy/reserve_vram_gb/disable_smart_memory/auto_flush_vram_threshold_gb route directly; raw HS keys reserve_vram\u2192reserve_vram_gb, highvram/lowvram/normalvram\u2192vram_policy, cache_none/cache_classic/cache_lru\u2192cache_policy; unknown\u2192extra). Conflict precedence: apply HS-translated keys first, then typed-name keys overwrite. (c) SessionConfig.from_dict(d) and SessionConfig.from_workflow_metadata(workflow) (delegates to from_dict on workflow.metadata.get('comfy_configuration', {})). (d) class VibeSession(Protocol) with start/run/flush/reconfigure/stop and last_fingerprint attr. (e) class EmbeddedSession(VibeSession) holding one long-lived Comfy() across calls (start instantiates Comfy with _embedded_configuration_for_session, queue_prompt_api in run, clear_cache in flush, reconfigure passes a new Configuration, stop tolerates model_mmap_residency AttributeError). (f) _embedded_configuration_for_session(config: SessionConfig) -> Configuration | None (apply order: typed fields \u2192 config.extra \u2192 VIBECOMFY_COMFY_CONFIGURATION env override; returns None if merged dict empty matching run.py:174-175). (g) _embedded_configuration(workflow) -> Configuration | None thin wrapper around _embedded_configuration_for_session(SessionConfig.from_workflow_metadata(workflow)) \u2014 preserves existing public signature. (h) Pattern-based model_fingerprint(api_dict) -> tuple \u2014 any class_type containing 'Loader' (and not in OVERRIDES_EXCLUDE), plus members of OVERRIDES_INCLUDE, contributes its non-edge string-valued input slots as sorted (class_type, slot, value) triples; OVERRIDES sets start empty.",
"depends_on": [],
"status": "done",
"executor_notes": "Created runtime/session.py with SessionConfig, VibeSession Protocol, EmbeddedSession, _embedded_configuration_for_session, _embedded_configuration workflow wrapper, model_fingerprint, and relocated RunResult/_prepare_prompt/_run_metadata/_collect_output_paths/_git_sha. Updated runtime/run.py to import relocated helpers from session.py and keep _embedded_configuration resolvable from runtime.run. Verified no reverse import from session.py to run.py, import check passed, partition conflict spot checks passed, python -m pytest tests/test_runtime_run.py passed, and full python -m pytest passed.",
"files_changed": [
"vibecomfy/runtime/session.py",
"vibecomfy/runtime/run.py"
],
"commands_run": [
"python -m compileall vibecomfy/runtime/session.py vibecomfy/runtime/run.py",
"python -c 'import vibecomfy.runtime.session; import vibecomfy.runtime.run; from vibecomfy.runtime import RunResult; print(RunResult.name)'",
"python -m pytest tests/test_runtime_run.py",
"python -m pytest"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T2",
"description": "Add the auto-flush gate inside EmbeddedSession.run in session.py. Before queueing: compute fp = model_fingerprint(api_dict). Resolve effective warm policy: os.environ.get('VIBECOMFY_WARM') overrides config.warm_policy. Behavior: 'never' \u2192 flush() then queue; 'always' \u2192 never auto-flush; 'auto' \u2192 flush iff last_fingerprint is not None and fp != last_fingerprint and _free_vram_gb() < config.auto_flush_vram_threshold_gb. After successful queue: self.last_fingerprint = fp. Add _free_vram_gb() helper that lazily imports comfy.model_management.get_free_memory() and returns float('inf') on any ImportError/AttributeError so missing GPU/torch doesn't break the gate.",
"depends_on": [
"T1"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T3",
"description": "Refactor run_embedded() in vibecomfy/runtime/run.py:116-156 to be a thin wrapper around EmbeddedSession.start()/run()/stop(). Public signatures of run_embedded and run_embedded_sync MUST remain unchanged. Delete the relocated helper bodies from run.py and import them from session.py. Re-export _embedded_configuration from run.py so from vibecomfy.runtime.run import _embedded_configuration continues to resolve (commands/doctor.py:56 and tests/test_runtime_run.py:116 depend on this). Verify vibecomfy/commands/doctor.py:56-60 still works without modification (it passes a VibeWorkflow, which routes through the wrapper).",
"depends_on": [
"T1",
"T2"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T4",
"description": "Create tests/test_runtime_session.py for EmbeddedSession. Reuse the sys.modules injection pattern from tests/test_runtime_run.py:140-149. FakeComfy records enter/exit counts plus queue_prompt_api/clear_cache/reconfigure call args. Required cases: (1) two sequential session.run(workflow_a) calls produce exactly one aenter/aexit pair. (2) flush() invokes clear_cache() exactly once. (3) reconfigure(SessionConfig(...)) passes a Configuration whose typed fields reflect SessionConfig. (4) from_workflow_metadata carry-through (raw HS): metadata {reserve_vram: 12, cache_none: True, fp8_e4m3fn_text_enc: True} \u2192 config.reserve_vram_gb == 12, cache_policy == 'none', extra == {fp8_e4m3fn_text_enc: True}; then _embedded_configuration_for_session yields Configuration with all three keys. (5) from_dict mirror with same raw-HS dict produces identical SessionConfig. (6) from_dict typed names: {port: 8200, vram_policy: 'high', reserve_vram_gb: 2.0, cache_policy: 'lru:3', warm_policy: 'always'} \u2192 SessionConfig(port=8200, vram_policy='high', reserve_vram_gb=2.0, cache_policy='lru:3', warm_policy='always', extra={}). (7) from_dict mixed: {port: 8200, reserve_vram: 12, fp8_e4m3fn_text_enc: True} \u2192 SessionConfig(port=8200, reserve_vram_gb=12, extra={fp8_e4m3fn_text_enc: True}). (8) typed-vs-HS conflict: {reserve_vram_gb: 2.0, reserve_vram: 12} resolves to reserve_vram_gb == 2.0. (9) empty: from_dict({}) \u2192 all defaults, empty extra. (10) Pattern-based fingerprint snapshot tests: wan_t2v.api.json (UNETLoader/CLIPLoader/VAELoader widget_0), ltx2_3_t2v.api.json (LowVRAMCheckpointLoader, LowVRAMAudioVAELoader, LTXAVTextEncoderLoader, LoraLoaderModelOnly), synthetic dict with DualCLIPLoaderGGUF/UnetLoaderGGUF \u2014 assert edge references (list values) NOT included. (11) Auto-flush truth table with mocked _free_vram_gb: same fingerprint + low VRAM \u2192 no flush; different fingerprint + low VRAM \u2192 flush; different fingerprint + high VRAM \u2192 no flush; same loader + different KSampler seed \u2192 no flush. (12) VIBECOMFY_WARM=never flushes before every run; VIBECOMFY_WARM=always never auto-flushes. Confirm existing tests/test_runtime_run.py:98-121 (test_embedded_configuration_uses_hiddenswitch_configuration_object) passes unchanged.",
"depends_on": [
"T1",
"T2",
"T3"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T5",
"description": "Add ServerSession backend in session.py. Extract subprocess startup from runtime/server.py:27-41 into _spawn_comfy_server(config: SessionConfig) -> tuple[Process, str, log_handle] in session.py. Translate SessionConfig to CLI flags: --highvram|--lowvram|--normalvram (skip when 'auto'), --reserve-vram <GB>, --disable-smart-memory, --cache-classic|--cache-lru N|--cache-none (skip when 'smart'), --port <P>. Reuse the 120-iteration /system_stats readiness loop. Add class ServerSession(VibeSession): start() calls _spawn_comfy_server; run() calls ComfyClient(self.url).queue_prompt(api_dict) wrapped by the same auto-flush gate from T2; flush() POSTs /api/free with {unload_models: True, free_memory: True}; reconfigure(config) is restart-on-change (compare CLI argv); stop() SIGTERM with 15s timeout fallback to SIGKILL. Add ComfyClient.free(unload_models, free_memory) in runtime/client.py:30+ with a one-line docstring noting queue-async semantics.",
"depends_on": [
"T1",
"T2"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T6",
"description": "Create vibecomfy/commands/session.py with argparse for start/stop/list/flush/status AND in-process daemon entrypoint (single file). Daemon invocation: python -m vibecomfy.commands.session --daemon --id NAME --config <json>. Daemon body: config_dict = json.loads(args.config); session = ServerSession(SessionConfig.from_dict(config_dict)); await session.start(); write out/sessions/<id>/{pid,url,config.json}; install SIGTERM handler that calls await session.stop() and removes pidfile; sleep on asyncio.Event. Daemonize from session start via subprocess.Popen([sys.executable, '-m', 'vibecomfy.commands.session', '--daemon', '--id', id_, '--config', json.dumps(config)], stdout=DEVNULL, stderr=open(log_path,'ab'), start_new_session=True). Parent assembles config dict from CLI flags as TYPED-NAME dict matching SessionConfig field names (omit None values): {port, vram_policy, reserve_vram_gb, cache_policy, warm_policy, disable_smart_memory}. Parent waits up to 120 s for out/sessions//url. Subcommands: start [--id NAME=default] [--vram-policy auto|high|low|normal] [--reserve-vram-gb F] [--cache-policy smart|classic|lru:N|none] [--disable-smart-memory] [--warm-policy auto|always|never] [--port P=8188], stop <id>, list, flush <id> [--unload-models/--no-unload-models] [--free-memory/--no-free-memory], status <id>. Add find_active_session(id='default') -> str | None in runtime/session.py: read out/sessions//url; if pidfile present and os.kill(pid, 0) succeeds return URL else clean up and return None. Register CommandSpec('session', 'vibecomfy.commands.session') in vibecomfy/commands/init.py:14-28 BETWEEN 'runtime' and 'logs'. Update tests/test_cli.py:25-40 to insert 'session' between 'runtime' and 'logs' in the asserted ordered list. Make warm-managed default for vibecomfy run (vibecomfy/commands/run.py): change --runtime default from 'embedded' to 'auto'; at top of _cmd_run BEFORE get_schema_provider, when args.runtime in ('auto','server') and --server-url not set, call find_active_session('default'); resolve effective runtime (auto + warm \u2192 server@URL, auto + no warm \u2192 embedded one-shot, server + warm \u2192 reuse, server + no warm \u2192 existing one-shot managed). Pass URL into both get_schema_provider('auto', server_url=session_url) AND run_sync(..., server_url=session_url, ...).",
"depends_on": [
"T5"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T7",
"description": "Add ServerSession + CLI tests. In tests/test_runtime_session.py append ServerSession tests with monkeypatched asyncio.create_subprocess_exec and stub httpx.AsyncClient. Required cases: (1) start() invokes subprocess with expected CLI argv given SessionConfig(vram_policy='high', reserve_vram_gb=2.0, cache_policy='lru:3', disable_smart_memory=True, port=8200) \u2014 assert --highvram, --reserve-vram 2.0, --cache-lru 3, --disable-smart-memory, --port 8200. (2) two session.run(...) calls share one subprocess (spawn count == 1). (3) flush() POSTs /api/free with {unload_models: True, free_memory: True}. (4) reconfigure(same_config) is a no-op; reconfigure(different_cli_args) triggers stop+start. (5) stop() SIGTERMs once, falls back to SIGKILL after 15 s. Create tests/test_session_cli.py: mock subprocess.Popen so 'daemon' is replaced by a synchronous helper that writes out/sessions//{pid,url,config.json} with synthetic alive pid. Assert: start returns 0 + creates files; list prints active id+URL; flush calls ComfyClient.free(True, True); stop removes files; find_active_session returns URL when pid alive, None (and cleans up) when pid dead. Add daemon-config carry-through tests (FLAG-012): (a) typed-name path \u2014 directly call daemon entrypoint with parsed {port:8200, vram_policy:'high', reserve_vram_gb:2.0, cache_policy:'lru:3', warm_policy:'always'} \u2192 ServerSession constructor receives SessionConfig(port=8200, vram_policy='high', reserve_vram_gb=2.0, cache_policy='lru:3', warm_policy='always', extra={}) (mock ServerSession.start to record). (b) raw HS path \u2014 {reserve_vram:12, cache_none:True, fp8_e4m3fn_text_enc:True, port:8200} \u2192 ServerSession(SessionConfig(reserve_vram_gb=12, cache_policy='none', port=8200, extra={fp8_e4m3fn_text_enc:True})). Add tests/test_runtime_run.py regression: _cmd_run with --runtime auto and a fake active session in out/sessions/default/url calls run_sync with that URL AND constructs schema provider with same URL. Add a regression case: --runtime auto with no active session falls back to embedded one-shot.",
"depends_on": [
"T6"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T8",
"description": "Update documentation. (1) Append 'Warm sessions' section to docs/runtime_lifecycle.md covering: Embedded vs Server backends, the vibecomfy session CLI (start/stop/list/flush/status), warm-policy rules (auto|always|never), /api/free queue-flag semantics (async, takes effect at next prompt boundary), VIBECOMFY_WARM env override, the pattern-based loader fingerprint (any class_type containing 'Loader' contributes non-edge string-valued slots), the SessionConfig.extra escape hatch, and the new auto default routing. (2) Append a VibeSession API block to docs/runtime_surface.md under 'Embedded Surface' (start/run/flush/reconfigure/stop + SessionConfig fields including extra). (3) Update docs/runtime_lifecycle.md:3 to reflect vibecomfy run now defaults to auto.",
"depends_on": [
"T6",
"T7"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T9",
"description": "Create scripts/warm_session_smoke.py \u2014 a manual GPU smoke script that runs two cheap workflows back-to-back through one EmbeddedSession and prints elapsed deltas. Must not be wired into automated test runs. Should print comfy.model_management.current_loaded_models length between calls (info-only) so an operator can confirm warmth.",
"depends_on": [
"T1",
"T2",
"T3"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T10",
"description": "Run validation. Execute in this order: (1) pytest tests/test_cli.py \u2014 confirm registry assertion still passes after adding 'session'. (2) pytest tests/test_runtime_run.py \u2014 run_embedded refactor + helper relocation preserves existing behavior; test_embedded_configuration_uses_hiddenswitch_configuration_object passes via re-exported wrapper; new --runtime auto fallback case passes. (3) pytest tests/test_runtime_session.py \u2014 embedded + server session unit tests including from_workflow_metadata/from_dict partition tests and pattern-based fingerprint snapshots. (4) pytest tests/test_session_cli.py \u2014 daemon CLI flow + daemon-config carry-through (typed and raw HS paths). (5) Full pytest \u2014 confirm no collateral damage; vibecomfy/commands/doctor.py:56-60 still imports _embedded_configuration from runtime.run and passes a VibeWorkflow without modification. If any test fails, read the error, fix the code, and re-run until they pass. Do NOT create new test files beyond the two named in T4/T7. Then write a short throwaway script that reproduces the warm-session bug (create EmbeddedSession, run twice, assert FakeComfy enter/exit count == 1; or create ServerSession with mocked subprocess, run twice, assert spawn count == 1), run it to confirm the fix works, then delete it.",
"depends_on": [
"T1",
"T2",
"T3",
"T4",
"T5",
"T6",
"T7",
"T8",
"T9"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
}
],
"watch_items": [
"FLAG-012 (must): _partition_comfy_config MUST accept BOTH typed SessionConfig field names AND raw HiddenSwitch keys in the same dict. Conflict precedence: HS-translated keys applied first, typed-name keys overwrite. The typed-vs-HS conflict test (T4 case 8) is the canonical assertion.",
"FLAG-010/callers (must): _embedded_configuration KEEPS its existing (workflow: VibeWorkflow) -> Configuration public signature. Three current callers \u2014 vibecomfy/runtime/run.py:125, tests/test_runtime_run.py:116, vibecomfy/commands/doctor.py:56-60 \u2014 MUST work without modification. The actual logic moves to _embedded_configuration_for_session(config: SessionConfig); the workflow-taking helper is a one-line wrapper. run.py re-exports it so from vibecomfy.runtime.run import _embedded_configuration keeps resolving.",
"FLAG-007/circular import: relocation direction is one-way \u2014 run.py imports from session.py, never the reverse. Verify after T1 with python -c 'import vibecomfy.runtime.session; import vibecomfy.runtime.run'.",
"FLAG-006 fingerprint scope: the extractor is PATTERN-BASED ('Loader' substring), NOT a hard-coded class list. Empty OVERRIDES_INCLUDE/OVERRIDES_EXCLUDE sets reserved for future exceptions. The synthetic-dict + ltx2_3_t2v.api.json snapshot tests in T4 are the proof.",
"Edge references (list values like ['12', 0]) on a loader node must NOT be included in the fingerprint \u2014 only non-edge string-valued slots. Test must assert this explicitly.",
"FLAG-008/test_cli.py registry: when adding CommandSpec('session', ...) between 'runtime' and 'logs', the existing exact-ordered COMMANDS assertion at tests/test_cli.py:25-40 will break unless updated in the same diff. T6 includes this update.",
"FLAG-002 warm-default: --runtime default flips from 'embedded' to 'auto'. With no warm session present, behavior MUST remain backwards-compatible (embedded one-shot). The fallback regression test in T7 covers this.",
"FLAG-004 schema-provider URL plumbing: get_schema_provider construction in _cmd_run must happen AFTER find_active_session and receive the discovered URL via server_url=session_url. Otherwise a second cold runtime would spawn for /object_info \u2014 the bug the brief explicitly calls out.",
"/api/free is QUEUE-ASYNC (sets prompt_queue.set_flag), NOT synchronous unload. Tests assert payload + endpoint, not actual model-unload completion. ComfyClient.free docstring must call this out.",
"stop() must tolerate model_mmap_residency AttributeError on Comfy.aexit (this is the cleanup path that nukes warm state at embedded_comfy_client.py:_cleanup; tolerate it on shutdown).",
"_free_vram_gb() must not crash on missing torch/comfy import \u2014 return float('inf') so the auto-flush gate is conservative on dev mac.",
"SessionConfig field-name vs raw-HS-key collision (e.g. caller passes both reserve_vram_gb=2.0 and reserve_vram=12 in one dict): apply HS-translated keys first, typed-name keys overwrite. Document in _partition_comfy_config docstring.",
"Daemon spawn uses start_new_session=True so the daemon survives parent shell exit. Pidfile + URL file land under out/sessions// with default id 'default'. Stale pidfile auto-cleanup when recorded pid is dead.",
"Auto-flush threshold default = 2.0 GB free VRAM. ServerSession default port 8188 with --port override.",
"find_active_session must clean up stale pidfile/url files when os.kill(pid, 0) raises ProcessLookupError, then return None \u2014 otherwise warm-default routing will keep trying to attach to dead daemons.",
"Manual GPU smoke (T9) cannot run on dev mac \u2014 info-only criterion. Test-layer subprocess-spawn-count + /api/free payload assertions are the actual verification gate for managed-mode warmth.",
"Existing run_embedded and run_sync public signatures MUST remain unchanged. They become thin wrappers around the new session abstraction; backwards compatibility is a hard requirement.",
"Subjective_judgment 'should' criteria \u2014 session.py under ~550 lines and docs quality in runtime_lifecycle.md/runtime_surface.md \u2014 require human inspection. Don't break them, but they're not test-gated.",
"No new runtime dependencies in pyproject.toml \u2014 httpx + stdlib only.",
"When relocating helpers, watch for imports of these names elsewhere in the codebase. Only run.py:_embedded_configuration is documented as having external callers (doctor.py + tests/test_runtime_run.py); the others (RunResult, _prepare_prompt, _run_metadata, _collect_output_paths, _git_sha) move freely. RunResult must still be importable as from vibecomfy.runtime import RunResult via init re-export.",
"Tests use the sys.modules injection pattern from tests/test_runtime_run.py:140-149 \u2014 no new test deps; pyproject.toml stays at httpx + pytest + pytest-asyncio."
],
"sense_checks": [
{
"id": "SC1",
"task_id": "T1",
"question": "Does session.py contain VibeSession Protocol, SessionConfig (with extra field), EmbeddedSession, _embedded_configuration_for_session, _embedded_configuration (workflow-taking wrapper), model_fingerprint, plus the relocated RunResult/_prepare_prompt/_run_metadata/_collect_output_paths/_git_sha \u2014 and does run.py import from session.py with no reverse import?",
"executor_note": "Confirmed session.py contains VibeSession Protocol, SessionConfig with extra, EmbeddedSession, _embedded_configuration_for_session, _embedded_configuration, model_fingerprint, and relocated RunResult/_prepare_prompt/_run_metadata/_collect_output_paths/_git_sha. run.py imports from session.py, session.py does not import run.py, and from vibecomfy.runtime import RunResult works.",
"verdict": ""
},
{
"id": "SC2",
"task_id": "T1",
"question": "Does _partition_comfy_config accept BOTH typed SessionConfig field names (port, vram_policy, cache_policy, warm_policy, reserve_vram_gb, disable_smart_memory, auto_flush_vram_threshold_gb) AND raw HiddenSwitch keys (reserve_vram, highvram/lowvram/normalvram, cache_none/cache_classic/cache_lru) in the same dict, with documented HS-first-then-typed-overwrite precedence?",
"executor_note": "Confirmed _partition_comfy_config accepts typed names and raw HiddenSwitch keys in the same dict. The implementation documents and applies HS-translated keys first, then typed-name overwrite; spot checks covered mixed input and {reserve_vram_gb: 2.0, reserve_vram: 12} resolving to reserve_vram_gb == 2.0.",
"verdict": ""
},
{
"id": "SC3",
"task_id": "T2",
"question": "Does the auto-flush gate honor VIBECOMFY_WARM (never\u2192pre-flush, always\u2192never auto-flush, auto\u2192fingerprint-change-and-low-VRAM), and does _free_vram_gb return float('inf') on import failure rather than crashing?",
"executor_note": "Trace EmbeddedSession.run with each VIBECOMFY_WARM value mocked. Independently call _free_vram_gb in an environment without comfy.model_management to confirm float('inf') return.",
"verdict": ""
},
{
"id": "SC4",
"task_id": "T3",
"question": "Are run_embedded/run_embedded_sync public signatures unchanged, does run.py re-export _embedded_configuration so commands/doctor.py:56 keeps working, and have all relocated helper bodies been deleted from run.py (only imports remain)?",
"executor_note": "Diff run.py against HEAD: helper definitions should be gone, only from vibecomfy.runtime.session import ... imports remain. from vibecomfy.runtime.run import _embedded_configuration should still resolve in a one-line REPL test.",
"verdict": ""
},
{
"id": "SC5",
"task_id": "T4",
"question": "Do the embedded-session tests cover all 12 required cases (sequential-runs single enter/exit, flush, reconfigure, from_workflow_metadata raw HS, from_dict raw HS mirror, from_dict typed names, from_dict mixed, typed-vs-HS conflict, empty, pattern-based fingerprint snapshots \u00d7 3, auto-flush truth table, VIBECOMFY_WARM=never/always) \u2014 including the explicit assertion that edge references (list values) are NOT included in the fingerprint?",
"executor_note": "Run pytest tests/test_runtime_session.py -v and grep the test names against the 12-case checklist. The edge-reference exclusion test is easy to forget \u2014 confirm it appears as its own assertion line.",
"verdict": ""
},
{
"id": "SC6",
"task_id": "T5",
"question": "Does ServerSession.start() spawn comfyui serve once and translate SessionConfig to the expected CLI argv (--highvram|--lowvram|--normalvram, --reserve-vram, --disable-smart-memory, --cache-classic|--cache-lru N|--cache-none, --port), and does flush() POST /api/free with {unload_models:True, free_memory:True} via the new ComfyClient.free?",
"executor_note": "Verify CLI flag translation by running the T7 argv test. Check ComfyClient.free includes the queue-async docstring. Confirm the auto-flush gate from T2 wraps ServerSession.run too (not just EmbeddedSession).",
"verdict": ""
},
{
"id": "SC7",
"task_id": "T6",
"question": "Is the daemon entrypoint a single file at vibecomfy/commands/session.py invokable via python -m vibecomfy.commands.session --daemon --id NAME --config <JSON>, does the parent assemble the typed-name config dict, does vibecomfy run --runtime auto thread the discovered URL into BOTH get_schema_provider AND run_sync, and is tests/test_cli.py:25-40 updated to include 'session' between 'runtime' and 'logs'?",
"executor_note": "Inspect run.py _cmd_run to confirm find_active_session is called BEFORE get_schema_provider, with the URL passed to both call sites. Run pytest tests/test_cli.py \u2014 if the registry assertion fails, the test wasn't updated.",
"verdict": ""
},
{
"id": "SC8",
"task_id": "T7",
"question": "Do the ServerSession + CLI tests assert spawn count == 1 across two runs, /api/free payload, daemon-config carry-through for BOTH typed-name and raw-HS JSON shapes, AND the auto-default fallback behavior (warm session attaches; no warm session falls back to embedded one-shot)?",
"executor_note": "Spot-check the FLAG-012 daemon test specifically \u2014 it must have two sub-cases (typed-name and raw-HS) with the constructor argument captured via a mock. Confirm the no-active-session fallback test exercises embedded one-shot rather than failing.",
"verdict": ""
},
{
"id": "SC9",
"task_id": "T8",
"question": "Do docs/runtime_lifecycle.md and docs/runtime_surface.md cover both backends, the session CLI, warm-policy rules, /api/free queue-async semantics, VIBECOMFY_WARM, the pattern-based fingerprint, the SessionConfig.extra escape hatch, and the new auto default?",
"executor_note": "Read both docs end-to-end. The /api/free queue-async note and the SessionConfig.extra escape-hatch note are easy to forget \u2014 grep for both keywords.",
"verdict": ""
},
{
"id": "SC10",
"task_id": "T9",
"question": "Does scripts/warm_session_smoke.py exercise EmbeddedSession (not ServerSession) so the second-call timing actually reflects in-process model warmth, and does it print current_loaded_models length between calls?",
"executor_note": "Embedded backend is mandated because ServerSession returns after queue submission and can't measure actual warmth. Confirm the script imports EmbeddedSession and not ServerSession.",
"verdict": ""
},
{
"id": "SC11",
"task_id": "T10",
"question": "Does the full pytest suite pass, including the ordered validation steps (test_cli first, then test_runtime_run, test_runtime_session, test_session_cli, then full pytest), and was a throwaway repro script run to confirm the warm-session fix and then deleted?",
"executor_note": "Capture each pytest invocation's exit status. The throwaway repro script must be deleted after the run \u2014 verify with git status showing no new untracked files outside the planned set.",
"verdict": ""
}
],
"meta_commentary": "Plan size is large (~10 tasks across three phases). Recommended execution order matches plan validation order: Phase 1 first (T1\u2192T2\u2192T3\u2192T4), then Phase 2 (T5\u2192T6\u2192T7), then docs (T8) and smoke (T9), then T10 to validate. Critical correctness traps to remember while executing: (1) The _partition_comfy_config dual-vocabulary contract is the single most-flagged correctness item across five gate iterations \u2014 both typed SessionConfig field names AND raw HiddenSwitch keys must be accepted in one dict; the typed-vs-HS conflict test (T4 case 8) and the daemon carry-through test (T7) are the canonical assertions. Get this wrong and the FLAG-012 work was wasted. (2) _embedded_configuration MUST keep its (workflow: VibeWorkflow) -> Configuration signature unchanged. The new logic lives in _embedded_configuration_for_session(SessionConfig); the workflow-taking helper is a one-line wrapper that routes through SessionConfig.from_workflow_metadata. Don't change the public signature. (3) Helper relocation is one-way (run.py imports session.py, never the reverse). The circular import was specifically called out and resolved \u2014 don't reintroduce it. (4) Pattern-based fingerprint, NOT a hard-coded class list. Anything containing 'Loader' (and not in OVERRIDES_EXCLUDE) qualifies. Edge references (list values) are excluded \u2014 string values only. (5) Warm-default routing: --runtime default flips from 'embedded' to 'auto'. The schema-provider URL must be threaded BEFORE get_schema_provider construction so a second cold runtime doesn't spawn for /object_info. Both run_sync AND get_schema_provider receive the same URL. (6) test_cli.py:25-40 has an exact-ordered COMMANDS assertion \u2014 it WILL break when 'session' is registered unless updated in the same change. (7) /api/free is queue-async; tests assert payload, not synchronous unload completion. (8) Daemon spawn uses start_new_session=True; pidfile + URL files under out/sessions//. find_active_session cleans up stale pidfiles when os.kill(pid, 0) raises. (9) GPU smoke (T9) is info-only; the dev mac can't run it. The test layer (spawn count == 1 + /api/free payload) is the real warmth-verification gate. Read tests/test_runtime_run.py:140-149 first to copy the sys.modules injection pattern \u2014 all new tests use it. The plan went through 5 critique iterations; trust the settled decisions in the plan body and don't second-guess them.",
"validation": {
"plan_steps_covered": [
{
"plan_step_summary": "Step 1: Create vibecomfy/runtime/session.py with VibeSession Protocol, SessionConfig (with extra + from_dict + from_workflow_metadata + dual-vocabulary _partition_comfy_config), EmbeddedSession, _embedded_configuration_for_session, _embedded_configuration wrapper, pattern-based model_fingerprint; relocate shared runtime helpers from run.py; update runtime/init.py re-export",
"finalize_task_ids": [
"T1"
]
},
{
"plan_step_summary": "Step 2: Add auto-flush gate inside EmbeddedSession.run with VIBECOMFY_WARM override and _free_vram_gb helper",
"finalize_task_ids": [
"T2"
]
},
{
"plan_step_summary": "Step 3: Refactor run_embedded into one-shot wrapper around EmbeddedSession; delete relocated helper bodies from run.py; re-export _embedded_configuration",
"finalize_task_ids": [
"T3"
]
},
{
"plan_step_summary": "Step 4: Tests for embedded session \u2014 sequential-runs warmth, flush, reconfigure, from_workflow_metadata + from_dict partition tests (raw-HS, typed-name, mixed, conflict, empty), pattern-based fingerprint snapshots, auto-flush truth table, VIBECOMFY_WARM cases",
"finalize_task_ids": [
"T4"
]
},
{
"plan_step_summary": "Step 5: ServerSession backend with _spawn_comfy_server CLI-flag translation, /api/free flush, restart-on-change reconfigure, SIGTERM/SIGKILL stop; ComfyClient.free helper",
"finalize_task_ids": [
"T5"
]
},
{
"plan_step_summary": "Step 6: Daemon CLI vibecomfy/commands/session.py (start/stop/list/flush/status + --daemon entrypoint), find_active_session, register CommandSpec, update tests/test_cli.py registry assertion, change vibecomfy run --runtime default to auto with URL threading into get_schema_provider AND run_sync",
"finalize_task_ids": [
"T6"
]
},
{
"plan_step_summary": "Step 7: Tests for ServerSession (subprocess argv, spawn-count==1, flush payload, reconfigure no-op vs restart, SIGTERM\u2192SIGKILL) + CLI (start/stop/list/flush, find_active_session pid-alive/dead, daemon-config carry-through for typed and raw-HS shapes) + auto-default routing regression in test_runtime_run.py",
"finalize_task_ids": [
"T7"
]
},
{
"plan_step_summary": "Step 8: Append Warm sessions section to docs/runtime_lifecycle.md and VibeSession API block to docs/runtime_surface.md; update docs/runtime_lifecycle.md:3 to reflect auto default",
"finalize_task_ids": [
"T8"
]
},
{
"plan_step_summary": "Step 9: Add scripts/warm_session_smoke.py manual GPU smoke using EmbeddedSession with elapsed deltas + current_loaded_models inspection",
"finalize_task_ids": [
"T9"
]
},
{
"plan_step_summary": "Validation: ordered pytest runs (test_cli, test_runtime_run, test_runtime_session, test_session_cli, full pytest) + throwaway repro script",
"finalize_task_ids": [
"T10"
]
}
],
"orphan_tasks": [],
"completeness_notes": "All 9 plan steps map to dedicated tasks T1\u2013T9; T10 covers the plan's 5-step validation order plus the throwaway-repro requirement. The only plan content not broken into a separate task is the validation order itself, which is consolidated inside T10 (the executor must run the steps in the listed order so registry/refactor failures surface first). The 'should' subjective criteria (line-count cap, doc quality, no new deps) are tracked in watch_items rather than as separate tasks because they're cross-cutting checks during T1/T8.",
"coverage_complete": true
},
"baseline_test_failures": [],
"baseline_test_command": "pytest --tb=no -q --no-header",
"baseline_test_note": "Baseline not run during finalize (this is a planning-only step). T10 begins with the ordered validation sequence: pytest tests/test_cli.py \u2192 pytest tests/test_runtime_run.py \u2192 pytest tests/test_runtime_session.py \u2192 pytest tests/test_session_cli.py \u2192 full pytest. The executor should snapshot a baseline pytest run BEFORE starting T1 to identify any pre-existing failures that should be ignored, then ensure no new failures are introduced."
}
code
Debt watch items (do not make these worse):
[DEBT] are-the-proposed-changes-technically-correct: are the proposed changes technically correct?: for ordinary pairs, the new diagnosis is not well-supported by the repo. the current sync effect in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/tools/travel-between-images/components/shotimageseditor/hooks/usesegmentslotmode.ts already syncs url and primaryvariantid, and the regenerate path reads exactly starturl, endurl, startgenid, endgenid, startvariantid, and endvariantid from segmentslotmode.pairdata in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/domains/media-lightbox/hooks/usevideoregeneratemode.ts. adding thumburl and generationid to the sync does not, by itself, explain why an old image url is still being used for regular pairs. (flagged 1 times across 1 plans)
[DEBT] are-the-proposed-changes-technically-correct: are the proposed changes technically correct?: the fix is incomplete for extra trailing slots. handlepairclick can populate activepairdata from trailingpairdata when pairindex === pairdatabyindex.size in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/tools/travel-between-images/components/shotimageseditor/hooks/usesegmentslotmode.ts, but the proposed sync effect only reads pairdatabyindex.get(segmentslotlightboxindex). for those trailing-slot cases fresh is undefined, so no image refresh happens. (flagged 1 times across 1 plans)
[DEBT] are-the-proposed-changes-technically-correct: are the proposed changes technically correct?: the merge pseudocode does not actually sync 'all image fields' as claimed. it omits id and position from change detection, and when fresh.startimage or fresh.endimage becomes null it preserves the stale previous object instead of syncing that null state. as written, it also needs explicit null-guards around spreads of prev.startimage / prev.endimage to be safe in strict typescript. (flagged 1 times across 1 plans)
[DEBT] are-the-proposed-changes-technically-correct: are the proposed changes technically correct?: the plan's claim that worker_state.py:200-204 (the 30-minute startup safety net) catches abandoned pods that exited before patching is slightly imprecise. line 200-204 only runs when in_startup_phase is true, which requires startup_phase to be in ('deps_installing', 'deps_verified', 'worker_starting') per line 161. a pod that exits before its first patch has startup_phase = none, so in_startup_phase is false and the code falls through to the normal timeout checks (active_stale / not_claiming) at line 207+, not the 30-minute startup cap. both paths eventually reap the worker, so the end result is the same, but the overview's reasoning (naming 200-204 specifically) is wrong. worth correcting so future readers don't mis-reason about the invariant. (flagged 1 times across 1 plans)
[DEBT] are-the-proposed-changes-technically-correct: are the proposed changes technically correct?: checked worker_state.py line 161 (in_startup_phase = startup_phase in (...)) against the plan's assumption that subsequent lenient writes are safe. if deps_installing succeeds but deps_verified silently fails, startup_phase stays at 'deps_installing' and the 30-minute cap from line 200-204 applies — even though the pod is actually progressing through uv sync. on a slow runpod image with cold wheel downloads, uv sync --extra cuda124 plus wan2gp deps can take 20+ minutes. there's no concrete benchmark in the plan that says the 30-minute cap is safely above the expected sync time; if uv sync legitimately takes 25 minutes and the deps_verified patch fails on a transient network blip, the orchestrator will terminate a healthy pod. plan should either bump the cap or note that deps_verified swallowing is acceptable because the cap is generously above typical sync time. (flagged 1 times across 1 plans)
[DEBT] are-the-proposed-changes-technically-correct: are the proposed changes technically correct?: the path-mapping defect from the previous iteration is fixed, but a different technical gap remains around self_refiner. repository search shows shared.utils.self_refiner is imported by wan2gp/wgp.py, wan2gp/models/ltx2/ltx_pipelines/distilled.py, ti2vid_one_stage.py, ti2vid_two_stages.py, wan2gp/models/ltx2/ltx_pipelines/utils/helpers.py, and wan2gp/models/wan/any2video.py; the v4 plan still aligns wan2gp/shared/utils/self_refiner.py to upstream head without any concrete runtime step that exercises those code paths after the change, so the only repo-documented behavior check for that file is still missing from the executable body. (flagged 1 times across 1 plans)
[DEBT] are-the-success-criteria-well-prioritized-and-verifiable: are the success criteria well-prioritized and verifiable?: the attached success criteria are stale and do not match the current plan body. they still require 'no usestate for activepairdata', 'setactivepairdata fully removed', 'sync effect deleted', and 'onpairclick simplified to (pairindex: number) => void', which are the opposite of the current targeted-sync plan. as presented, the criteria are not usable for review or execution. (flagged 1 times across 1 plans)
[DEBT] audio-loading: getaudiodata in useeffect removes render-readiness signal (flagged 1 times across 1 plans)
[DEBT] audio-loading: same as correctness-3 — preview/render parity risk (flagged 1 times across 1 plans)
[DEBT] audio-loading: preview/render parity partially satisfied (flagged 1 times across 1 plans)
[DEBT] audio-reactivity: overlapping clips use first-found, volume not scaled (flagged 1 times across 1 plans)
[DEBT] audio-reactivity: same as audio-reactivity-1 — overlapping/volume-adjusted clips diverge from audible mix (flagged 1 times across 1 plans)
[DEBT] audio-reactivity: textclip missing globalframeprovider (flagged 1 times across 1 plans)
[DEBT] audio-reactivity: same as audio-reactivity-2 — textclipsequence missing provider (flagged 1 times across 1 plans)
[DEBT] audio-reactivity: textclip effects surface not covered (flagged 1 times across 1 plans)
[DEBT] audio-reactivity: continuous effects shared by visual and text clips (flagged 1 times across 1 plans)
[DEBT] batch-generation-pipeline: enhancement in usegeneratebatch before generatevideo() could compute prompts against a stale pair snapshot if mutations are still in flight. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-cascade-paths: cascade lookup only reads params->>'orchestrator_task_id_ref', missing shared reference paths and orchestrator-self detection. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-cascade-paths: duplicate of correctness-2 + correctness-3: invalid sql syntax and narrow cascade lookup. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-cascade-paths: shared orchestrator-reference helpers not referenced. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-cascade-paths: orchestrator tasks that crash don't get orchestrator-self cascade. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-cascade-paths: hardcoded params->>'orchestrator_task_id_ref' misses other reference paths. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-retry: crash requeue sql does not increment attempts, risking infinite requeue loop. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-retry: duplicate of correctness-1: attempts never advance on crash requeue. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-retry: missing attempts increment location in heartbeat sql. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-retry: step 6 under-scoped for real retry convergence and orchestrator-self handling. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-sql-syntax: bare select inside plpgsql is invalid — needs perform. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-testing: no multi-crash convergence test exercising attempts 0→1→2→3. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-testing: no validation that plpgsql body executes successfully. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-testing: criteria don't require proof of crash requeue convergence. (flagged 1 times across 1 plans)
[DEBT] criteria-verifiability: 'no unsafe .maybesingle()' criterion requires judgment about column uniqueness. (flagged 1 times across 1 plans)
[DEBT] criteria-verifiability: decision documentation location not specified. (flagged 1 times across 1 plans)
[DEBT] criteria-verifiability: the must criterion requiring 5 task types to exist as active db rows is not verifiable from code diff alone — it requires a live db query. (flagged 1 times across 1 plans)
[DEBT] db-fallback-testing: no new automated test for the db fallback dispatch path or dependant_on preservation for raw worker families. (flagged 1 times across 1 plans)
[DEBT] dependency-resolution: dependency resolution: the plan does not lock down the active python-version matrix even though the repo currently splits between python 3.10 local installs and a python 3.11 runpod image. (flagged 1 times across 1 plans)
[DEBT] did-the-work-fully-address-the-issue-hints-user-notes-and-approved-plan-requirements: did the work fully address the issue hints, user notes, and approved plan requirements?: the package is internally inconsistent. the plan body says to keep activepairdata in usestate and make phase 2 optional, but the attached metadata and success criteria still describe the previous derive-via-usememo / remove-setactivepairdata / simplify-onpairclick plan. that means the approved-plan requirements are only partially coherent as presented. (flagged 1 times across 1 plans)
[DEBT] did-the-work-fully-address-the-issue-hints-user-notes-and-approved-plan-requirements: did the work fully address the issue hints, user notes, and approved plan requirements?: the linux distro note is documentation-only; the generated install command in step 7 still runs apt-get install python3.10-venv python3.10-dev ffmpeg without any pre-check that the package exists. users on ubuntu 24.04+ who ignore the doc and try to copy-paste the command will hit a confusing e: unable to locate package python3.10-venv from apt rather than a targeted error from commandutils.ts. a one-line detection pre-check (e.g., apt-cache show python3.10-venv >/dev/null 2>&1 || { echo 'install deadsnakes ppa first — see readme'; exit 1; }) would convert the silent failure into an actionable error, but the plan does not add this. (flagged 1 times across 1 plans)
[DEBT] did-the-work-fully-address-the-issue-hints-user-notes-and-approved-plan-requirements: did the work fully address the issue hints, user notes, and approved plan requirements?: checked the revised v4 body against docs/wan2gp_fork_migration_plan.md sprint 2. the repo plan doc still lists an "ltx-2 self_refiner smoke against the pre-sprint behavioral baseline" as a sprint 2 verification gate and repeats that smoke in the functionality-preservation checks, but the revised execution steps no longer schedule that smoke anywhere; it survives only as an info-level metadata criterion. because wan2gp/shared/utils/self_refiner.py remains an explicit sprint 2 deliverable, the revised plan still only partially carries forward the verification package described in the source migration plan. (flagged 1 times across 1 plans)
[DEBT] does-the-change-touch-all-locations-and-supporting-infrastructure: does the change touch all locations and supporting infrastructure?: phase 1 still misses a real supporting-data location: trailingpairdata lives outside pairdatabyindex in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/tools/travel-between-images/components/shotimageseditor/hooks/usesegmentslotpresentationadapter.ts, but the proposed sync logic only considers pairdatabyindex. if trailing slot regenerate is part of the bug surface, that location is not covered. (flagged 1 times across 1 plans)
[DEBT] does-the-change-touch-all-locations-and-supporting-infrastructure: does the change touch all locations and supporting infrastructure?: the non-swallowing helper update_worker_phase_strict is a new shell function, but phase 1 step 2 introduces it only as pseudo-code. there is no concrete note that the helper must handle supabase http non-2xx responses as failures (curl returns 0 even on http 4xx/5xx by default unless -f or --fail-with-body is used). if the implementer ports update_worker_phase verbatim with only || return 0 removed, a 500 from supabase would still report success because curl's exit code is 0. the plan should specify curl --fail or explicit http status code checking in the strict variant. (flagged 1 times across 1 plans)
[DEBT] does-the-change-touch-all-locations-and-supporting-infrastructure: does the change touch all locations and supporting infrastructure?: the supporting-infrastructure review still finds one missing check. in docs/wan2gp_fork_migration_plan.md, sprint 2's verification matrix and risk register both single out self_refiner as a distinct drift-upgrade surface with its own smoke and its own silent-behavior-change risk, but the revised v4 body updates the file without keeping that supporting verification step in the actual execution checklist. (flagged 1 times across 1 plans)
[DEBT] edge-test-config: plan's vitest commands use the wrong config entry point. (flagged 1 times across 1 plans)
[DEBT] edge-test-config: same as verification-3: wrong vitest config in validation commands. (flagged 1 times across 1 plans)
[DEBT] edge-test-config: success criterion references wrong test command. (flagged 1 times across 1 plans)
[DEBT] error-handling: db loader error handling convention mismatch (plan says log+null, existing loaders throw) (flagged 1 times across 1 plans)
[DEBT] error-propagation-logging: generation.ts and handler.ts logging endpoints are not directly tested. (flagged 1 times across 1 plans)
[DEBT] error-propagation-testing: no end-to-end regression test for the full symptom chain (db error → tocompletionerror metadata → handler log). (flagged 1 times across 1 plans)
[DEBT] error-propagation-testing: handler.ts metadata surfacing criterion lacks a concrete automated verifier. (flagged 1 times across 1 plans)
[DEBT] error-propagation-testing: main issue only partially validated without an integration test. (flagged 1 times across 1 plans)
[DEBT] find-the-callers-of-the-changed-function-what-arguments-do-they-actually-pass-does-the-fix-handle-all-of-them: find the callers of the changed function. what arguments do they actually pass? does the fix handle all of them?: the step 2 retry loop uses a naked sleep 2 between attempts, which adds up to 6 seconds of latency on the happy path when the first patch eventually succeeds on attempt 2 or 3. for pods where supabase is reachable but slow during the initial moments of a cold runpod start, the retry logic is fine. however, if the first attempt fails with a tls handshake delay and the retry loop sleeps 2s per attempt regardless of whether curl itself has been blocking for tens of seconds, the total startup latency penalty could be substantial. this is a minor tuning concern, not a correctness issue. (flagged 1 times across 1 plans)
[DEBT] find-the-callers-of-the-changed-function-what-arguments-do-they-actually-pass-does-the-fix-handle-all-of-them: find the callers of the changed function. what arguments do they actually pass? does the fix handle all of them?: finding callers of the changed module shows that shared.utils.self_refiner is consumed by wan2gp/wgp.py, wan2gp/models/ltx2/ltx2_handler.py, multiple ltx2 pipeline modules, and wan2gp/models/wan/any2video.py. the revised validation steps still only drive the three bridge getters in source/runtime/wgp_ports/vendor_imports.py; none of the scheduled commands execute a real self_refiner caller, so the plan does not yet verify the main caller shapes for the other explicit sprint 2 file change. (flagged 1 times across 1 plans)
[DEBT] gpu-branching-test-matrix: linux cuda128 path under-verified (flagged 1 times across 1 plans)
[DEBT] gpu-branching-ui-surface: nvidia-50 option is exposed on linux in the ui but linux cuda128 smoke test is missing (flagged 1 times across 1 plans)
[DEBT] hook-abstraction: usepairsettingshandler becomes trivial with single caller — keeping it is extra indirection. (flagged 1 times across 1 plans)
[DEBT] is-the-change-in-the-right-place-and-would-it-break-any-callers: is the change in the right place, and would it break any callers?: the optional cleanup steps are not in the right place yet. pairregionslayer does not receive pairdatabyindex today; its props are only images, imagepositionswithpending, pairinfowithpending, and callback/display props in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/tools/travel-between-images/components/timeline/timelinecontainer/components/pairregionslayer.tsx. so step 4's 'pass pairdatabyindex.get(pairindex) directly' would require new prop plumbing or a different seam. (flagged 1 times across 1 plans)
[DEBT] is-the-scope-and-scale-of-the-change-appropriate: is the scope and scale of the change appropriate?: phase 2 is still under-specified for execution. step 4 says pairregionslayer should either pass pairdatabyindex.get(pairindex) directly or 'just pass the index + frame-only data', which are materially different designs. if phase 2 is kept in the plan, it needs a single concrete direction. (flagged 1 times across 1 plans)
[DEBT] is-there-convincing-verification-for-the-change: is there convincing verification for the change?: the plan still lacks an explicit automated regression test for the reported bug. step 2 is manual ('check that usevideoregeneratemode now gets the fresh url'), but there is no concrete test that opens a segment slot, changes the primary variant data, and asserts that the regenerate path sees the fresh url, generationid, and primaryvariantid. (flagged 1 times across 1 plans)
[DEBT] is-there-convincing-verification-for-the-change: is there convincing verification for the change?: the current usesegmentslotmode test remains only a smoke test in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/tools/travel-between-images/components/shotimageseditor/hooks/tests/usesegmentslotmode.test.ts, and the plan does not add behavior coverage for the new sync effect. (flagged 1 times across 1 plans)
[DEBT] is-there-convincing-verification-for-the-change: is there convincing verification for the change?: no verification step covers the trailing-slot branch, even though the proposed phase 1 logic currently misses trailingpairdata refreshes. (flagged 1 times across 1 plans)
[DEBT] legacy-data-backfill: the step 8 diagnostic query only detects cross-shot pair_shot_generation_id misassociations, not same-shot misassociations caused by timeline reordering within a shot. (flagged 1 times across 1 plans)
[DEBT] lookup-consistency: other repo call sites use unordered .limit(1).maybesingle() and will remain inconsistent. (flagged 1 times across 1 plans)
[DEBT] lookup-consistency: other call sites with same unsafe pattern not covered. (flagged 1 times across 1 plans)
[DEBT] lora-management: lora tools simplified vs full ui parity (multi-stage metadata, private loras) (flagged 1 times across 1 plans)
[DEBT] media-lightbox-persistence: variant switches do not clear/restore inpaintprompt, so stale prompt state can leak across variants with no cached prompt. (flagged 1 times across 1 plans)
[DEBT] media-lightbox-persistence: removing prompt/numgenerations from the variant-keyed localstorage cache means all variants within a generation share the same prompt. this broadens existing debt-002 (variant prompt leakage). (flagged 1 times across 1 plans)
[DEBT] media-lightbox-segment-slot: media lightbox / segment slot: the targeted sync rationale does not fully explain the reported stale-url bug for regular pairs, and the proposed effect still misses trailing-slot refreshes because those can come from trailingpairdata rather than pairdatabyindex. (flagged 1 times across 1 plans)
[DEBT] number-input-nullable: plan doesn't explicitly state onchange must also accept null, though step 3 depends on it. (flagged 1 times across 1 plans)
[DEBT] number-input-nullable: disputed v1 flag — original concern about bulkclippanel being unimplementable. (flagged 1 times across 1 plans)
[DEBT] number-input-nullable: onchange null filtering not explicitly addressed in plan. (flagged 1 times across 1 plans)
[DEBT] number-input-testing: no planned tests for numberinput shared component or bulkclippanel nullable draft flow. (flagged 1 times across 1 plans)
[DEBT] orchestrator-completion-rollout: pre-existing individual_travel_segment children won't drive orchestrator completion through segment_type_config after deploy. (flagged 1 times across 1 plans)
[DEBT] orchestrator-completion-rollout: missing compatibility seam in orchestratorcore.ts:123-126 for old individual_travel_segment rows. (flagged 1 times across 1 plans)
[DEBT] orchestrator-completion-rollout: mixed old/new data during rollout can leave old orchestrators without completion counting. (flagged 1 times across 1 plans)
[DEBT] orchestrator-completion-rollout: no test or deployment guard for pre-existing individual_travel_segment children completing after worker change. (flagged 1 times across 1 plans)
[DEBT] orchestrator-completion-rollout: plan overstates backward compatibility for existing data. (flagged 1 times across 1 plans)
[DEBT] orchestrator-completion-rollout: missing rollout compatibility step for in-flight individual_travel_segment tasks. (flagged 1 times across 1 plans)
[DEBT] orchestrator-completion-rollout: pre-deploy individual_travel_segment child completing post-rollout won't be treated as segment task by checkorchestratorcompletion. (flagged 1 times across 1 plans)
[DEBT] orchestrator-completion-rollout: orchestrator.test.ts criterion too narrow to verify old individual_travel_segment compatibility. (flagged 1 times across 1 plans)
[DEBT] pair-settings-plumbing: handleopenpairsettings(pairindex, pairframedata) path in timelinetrackprelude, segmentoutputstrip, and usesegmentoutputstrip not explicitly named. (flagged 1 times across 1 plans)
[DEBT] pair-settings-plumbing: same as flag-002 — segmentoutputstrip and usesegmentoutputstrip still carry pairframedata. (flagged 1 times across 1 plans)
[DEBT] pair-settings-plumbing: timelinetrackprelude and segmentoutputstrip still forward (pairindex, pairframedata). (flagged 1 times across 1 plans)
[DEBT] plan-scope: step 3 is larger than a light megaplan warrants. (flagged 1 times across 1 plans)
[DEBT] planning-metadata: planning metadata: the attached metadata and success criteria still describe a different implementation than the current plan body, which risks sending execution and review down the wrong path. (flagged 1 times across 1 plans)
[DEBT] planning-metadata: success criteria don't cover wave 4 scope (flagged 1 times across 1 plans)
[DEBT] position-key-semantics: plan investigates a unique constraint on (parent_generation_id, child_order) which doesn't match repo semantics for position keys. (flagged 1 times across 1 plans)
[DEBT] position-key-semantics: plan weights toward child_order rather than pair_shot_generation_id as the key that matters. (flagged 1 times across 1 plans)
[DEBT] position-key-semantics: unique constraint on (parent_generation_id, child_order) not supported by repo semantics. (flagged 1 times across 1 plans)
[DEBT] prompt-composition: the plan's step 1 signature includes textbeforeprompts/textafterprompts parameters that would be applied before enhancement, double-wrapping the prompt. (flagged 1 times across 1 plans)
[DEBT] ready-template-snapshots: step 4.2 drops markdownnote nodes but step 4.5 and the success criteria require class_type/widget parity with pre-refactor snapshots, which currently include markdownnote nodes. (flagged 1 times across 1 plans)
[DEBT] ready-template-snapshots: same tension as issue_hints v2: drop-markdownnote vs. snapshot parity. (flagged 1 times across 1 plans)
[DEBT] search-for-related-code-that-handles-the-same-concept-is-the-reported-issue-a-symptom-of-something-broader: search for related code that handles the same concept. is the reported issue a symptom of something broader?: checked the broader runtime surface after the v4 path fix. sprint 2 is still moving two behavior-sensitive seams rather than just the import-path contract: the wan2gp/ mount path and the self_refiner runtime. step 6.2 covers only the three vendor_imports getters, while the 6-file travel suite and the bridge-contract tests do not mention self_refiner, so dropping the dedicated self-refiner smoke from the runnable steps leaves the broader downstream surface of that changed file under-covered. (flagged 1 times across 1 plans)
[DEBT] self-refiner-verification: self-refiner verification: the revised plan still aligns wan2gp/shared/utils/self_refiner.py without scheduling the sprint 2 ltx-2 self_refiner smoke that docs/wan2gp_fork_migration_plan.md defines as the behavior-preservation check for that drift upgrade. (flagged 1 times across 1 plans)
[DEBT] settings-defaults: workerrepopath default can go stale if user switches computertype before editing path (flagged 1 times across 1 plans)
[DEBT] settings-resolution: settings cascade missing — shot-only read diverges from form's defaults→user→project→shot merge (flagged 1 times across 1 plans)
[DEBT] settings-resolution: settings cascade missing — shot-only read (flagged 1 times across 1 plans)
[DEBT] shared-component-compatibility: numberinput changes affect callers outside video-editor (billing, travel-between-images, phaseconfigselectormodal). (flagged 1 times across 1 plans)
[DEBT] shared-component-compatibility: shared ui component blast radius not audited in plan. (flagged 1 times across 1 plans)
[DEBT] shot-linking-testing: no test covers the linkgenerationtoshot error/catch branches. (flagged 1 times across 1 plans)
[DEBT] signature-propagation: plan doesn't explicitly name timeline/index.tsx and segmentslotcontracts.ts for updates. (flagged 1 times across 1 plans)
[DEBT] signature-propagation: same as flag-001 — timeline/index.tsx and segmentslotcontracts.ts not in checklist. (flagged 1 times across 1 plans)
[DEBT] signature-propagation: five supporting contract/plumbing sites not named in the checklist. (flagged 1 times across 1 plans)
[DEBT] task-types-verification: step 3 cites wrong migration file (task_cost_configs instead of task_types) as evidence for db fallback path. (flagged 1 times across 1 plans)
[DEBT] task-types-verification: step 3 should cite task_types source, not task_cost_configs. (flagged 1 times across 1 plans)
[DEBT] task-types-verification: plan doesn't verify travel_segment and travel_stitch exist as active task_types rows using the correct table. (flagged 1 times across 1 plans)
[DEBT] test-coverage: current generation-child.test.ts is only a smoke test. (flagged 1 times across 1 plans)
[DEBT] test-coverage: no plan to verify other lookup paths choose rows consistently. (flagged 1 times across 1 plans)
[DEBT] test-coverage: no new tests for db loader or travel param merge path (flagged 1 times across 1 plans)
[DEBT] test-coverage: must-level criteria depend on manual testing rather than automated assertions (flagged 1 times across 1 plans)
[DEBT] test-coverage: no new unit tests for wave 4 tools (flagged 1 times across 1 plans)
[DEBT] test-coverage: must criteria backed by manual testing only (flagged 1 times across 1 plans)
[DEBT] test-infrastructure: no test fixtures for resources table (flagged 1 times across 1 plans)
[DEBT] timeline-drag-coordination: plan keeps two hooks instead of a single coordinator (flagged 1 times across 1 plans)
[DEBT] timeline-drag-coordination: brief says single coordinator but plan keeps separate hooks (flagged 2 times across 1 plans)
[DEBT] timeline-drag-coordination: pendingopsref retained despite brief suggesting removal (flagged 1 times across 1 plans)
[DEBT] timeline-drag-coordination: wrapper-bound listener mount wiring under-specified (flagged 1 times across 1 plans)
[DEBT] timeline-persistence: read path still assembles config and registry from separate requests (flagged 1 times across 1 plans)
[DEBT] timeline-persistence: poll sync verification not structurally changed (flagged 1 times across 1 plans)
[DEBT] timeline-persistence: backend save helpers not wired to new rpc (flagged 1 times across 1 plans)
[DEBT] timeline-persistence: read infrastructure not updated (flagged 1 times across 1 plans)
[DEBT] timeline-persistence: backend tests not in validation list (flagged 1 times across 1 plans)
[DEBT] timeline-persistence: backend callers not migrated (flagged 1 times across 1 plans)
[DEBT] timeline-persistence: broader persistence-contract problem (flagged 1 times across 1 plans)
[DEBT] timeline-persistence: backend split-save not addressed (flagged 1 times across 1 plans)
[DEBT] timeline-persistence: split polling can combine config and registry from different snapshots (flagged 1 times across 1 plans)
[DEBT] timeline-scaling: the plan only specifies a concrete fix for the default scale(1) case; explicit-scale tracks may still break blend-mode effects. (flagged 1 times across 1 plans)
[DEBT] timeline-snap-threshold: threshold is generous (duration) rather than zoom-scaled (8px) (flagged 1 times across 1 plans)
[DEBT] timeline-snap-threshold: computedropposition does not pass a zoom-scaled threshold override (flagged 1 times across 1 plans)
[DEBT] travel-continuations: smooth continuations not threaded — agent tasks won't have continuation_config even when shot settings enable it (flagged 1 times across 1 plans)
[DEBT] travel-continuations: continuation_config omitted from form parity (flagged 1 times across 1 plans)
[DEBT] travel-payload-cleanup-scope: plan scope narrower than original user request (flagged 1 times across 1 plans)
[DEBT] travel-payload-cleanup-scope: broader create-task contract problem left untouched (flagged 1 times across 1 plans)
[DEBT] travel-payload-readers: phase 4 app-side reader audit incomplete (flagged 1 times across 1 plans)
[DEBT] travel-payload-readers: phase 4 field inventory incomplete for app-side readers (flagged 1 times across 1 plans)
[DEBT] travel-request-contract: image_variant_ids is in frontend request contract (flagged 1 times across 1 plans)
[DEBT] travel-request-contract: image_variant_ids contract change (flagged 1 times across 1 plans)
[DEBT] variant-update-b-fresh-takeover: spawn_worker does not internally call start_worker_process; harness must call both explicitly (flagged 1 times across 1 plans)
[DEBT] variant-update-b-fresh-takeover: worker_id and runpod_id must be generated and threaded distinctly; plan currently uses pod_id as both (flagged 1 times across 1 plans)
[DEBT] variant-update-b-fresh-takeover: duplicate of correctness-1 — spawn_worker two-step misstatement (flagged 2 times across 1 plans)
[DEBT] variant-update-b-fresh-takeover: duplicate of correctness-2 — worker_id/runpod_id propagation across takeover and restore paths (flagged 1 times across 1 plans)
[DEBT] variant-update-b-fresh-takeover: duplicate of correctness-1 + correctness-2 — missing create_worker_record glue and start_worker_process integration (flagged 1 times across 1 plans)
[DEBT] variant-update-b-fresh-takeover: duplicate of correctness-2 — caller contract for spawn_worker requires worker_id, not pod_id (flagged 1 times across 1 plans)
[DEBT] verification: no end-to-end render test for audio analysis timing (flagged 1 times across 1 plans)
[DEBT] verification: no automated coverage for text clips or overlapping clips with audio effects (flagged 1 times across 1 plans)
[DEBT] verification-coverage: no automated test exercises the full segment-slot opening path after cleanup. (flagged 1 times across 1 plans)
[DEBT] verification-coverage: no automated coverage that clicking a pair opens the correct modal after cleanup. (flagged 1 times across 1 plans)
[DEBT] verification-coverage: zero behavioral change criterion is not verifiable from tsc + existing tests alone. (flagged 1 times across 1 plans)
[DEBT] verification-workflow: tsconfig.app.json excludes test files, so tsc won't catch test breakage. (flagged 1 times across 1 plans)
[DEBT] worker-test-staleness: worker test in test_additional_coverage_modules.py:37 may assert stale payload structure (task_type vs family). (flagged 1 times across 1 plans)
code
Note: User chose auto-approve mode. This execution was not manually reviewed at the gate. Exercise extra caution on destructive operations.
Robustness level: standard.
Requirements:
- Execute only the actionable tasks in this batch.
- Treat completed tasks as dependency context, not new work.
- Return structured JSON only.
- Only produce `task_updates` for these tasks: [T2]
- Only produce `sense_check_acknowledgments` for these sense checks: [SC3]
- Do not include updates for tasks or sense checks outside this batch.
- Keep `executor_notes` verification-focused.
- Best-effort progress checkpointing: if `/Users/user_c042661f/Documents/reigh-workspace/vibecomfy/.megaplan/plans/vibecomfy-warm-runtime-20260425-1936/execution_batch_2.json` is writable, checkpoint task and sense-check updates there (not `finalize.json`). The harness owns `finalize.json`.
- When verifying changes, run the entire test file or module, not individual test functions. Individual tests miss regressions.
- finalize.json includes baseline_test_failures — a list of test IDs that were already failing before your changes. If a test fails and its ID appears in baseline_test_failures, it is pre-existing — do not scope-creep into fixing it. If baseline_test_failures is null, the baseline could not be captured; use your judgment but err on the side of assuming failures are regressions. You MUST still re-run the FULL test suite with your changes applied — pre-existing failures do not excuse skipping verification. Never narrow to individual test functions and stop.
- If this batch includes the final verification task, write a short script that reproduces the exact bug described in the task, run it to confirm the fix resolves it, then delete the script.
code
Completed task context (already satisfied, do not re-execute unless directly required by current edits):
[
{
"id": "T1",
"description": "Create vibecomfy/runtime/session.py and relocate shared runtime helpers from run.py. Move RunResult (run.py:19-25), _prepare_prompt (run.py:28-42), _run_metadata (run.py:76-96), _collect_output_paths (run.py:204-215), _git_sha (run.py:99-109), and the body of _embedded_configuration (run.py:163-181) into session.py \u2014 run.py imports from session.py, never the reverse. Update vibecomfy/runtime/init.py:1-11 so from vibecomfy.runtime import RunResult keeps working (re-export through run.py). Define: (a) SessionConfig dataclass with fields vram_policy/reserve_vram_gb/cache_policy/disable_smart_memory/warm_policy/auto_flush_vram_threshold_gb/port/extra. (b) Private _partition_comfy_config(d) that splits a dict into typed-field kwargs vs extra \u2014 accepts BOTH typed SessionConfig field names AND raw HiddenSwitch keys per the FLAG-012 mapping table (typed names port/vram_policy/cache_policy/warm_policy/reserve_vram_gb/disable_smart_memory/auto_flush_vram_threshold_gb route directly; raw HS keys reserve_vram\u2192reserve_vram_gb, highvram/lowvram/normalvram\u2192vram_policy, cache_none/cache_classic/cache_lru\u2192cache_policy; unknown\u2192extra). Conflict precedence: apply HS-translated keys first, then typed-name keys overwrite. (c) SessionConfig.from_dict(d) and SessionConfig.from_workflow_metadata(workflow) (delegates to from_dict on workflow.metadata.get('comfy_configuration', {})). (d) class VibeSession(Protocol) with start/run/flush/reconfigure/stop and last_fingerprint attr. (e) class EmbeddedSession(VibeSession) holding one long-lived Comfy() across calls (start instantiates Comfy with _embedded_configuration_for_session, queue_prompt_api in run, clear_cache in flush, reconfigure passes a new Configuration, stop tolerates model_mmap_residency AttributeError). (f) _embedded_configuration_for_session(config: SessionConfig) -> Configuration | None (apply order: typed fields \u2192 config.extra \u2192 VIBECOMFY_COMFY_CONFIGURATION env override; returns None if merged dict empty matching run.py:174-175). (g) _embedded_configuration(workflow) -> Configuration | None thin wrapper around _embedded_configuration_for_session(SessionConfig.from_workflow_metadata(workflow)) \u2014 preserves existing public signature. (h) Pattern-based model_fingerprint(api_dict) -> tuple \u2014 any class_type containing 'Loader' (and not in OVERRIDES_EXCLUDE), plus members of OVERRIDES_INCLUDE, contributes its non-edge string-valued input slots as sorted (class_type, slot, value) triples; OVERRIDES sets start empty.",
"depends_on": [],
"status": "done",
"executor_notes": "Created runtime/session.py with SessionConfig, VibeSession Protocol, EmbeddedSession, _embedded_configuration_for_session, _embedded_configuration workflow wrapper, model_fingerprint, and relocated RunResult/_prepare_prompt/_run_metadata/_collect_output_paths/_git_sha. Updated runtime/run.py to import relocated helpers from session.py and keep _embedded_configuration resolvable from runtime.run. Verified no reverse import from session.py to run.py, import check passed, partition conflict spot checks passed, python -m pytest tests/test_runtime_run.py passed, and full python -m pytest passed.",
"files_changed": [
"vibecomfy/runtime/session.py",
"vibecomfy/runtime/run.py"
],
"commands_run": [
"python -m compileall vibecomfy/runtime/session.py vibecomfy/runtime/run.py",
"python -c 'import vibecomfy.runtime.session; import vibecomfy.runtime.run; from vibecomfy.runtime import RunResult; print(RunResult.name)'",
"python -m pytest tests/test_runtime_run.py",
"python -m pytest"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T2",
"description": "Add the auto-flush gate inside EmbeddedSession.run in session.py. Before queueing: compute fp = model_fingerprint(api_dict). Resolve effective warm policy: os.environ.get('VIBECOMFY_WARM') overrides config.warm_policy. Behavior: 'never' \u2192 flush() then queue; 'always' \u2192 never auto-flush; 'auto' \u2192 flush iff last_fingerprint is not None and fp != last_fingerprint and _free_vram_gb() < config.auto_flush_vram_threshold_gb. After successful queue: self.last_fingerprint = fp. Add _free_vram_gb() helper that lazily imports comfy.model_management.get_free_memory() and returns float('inf') on any ImportError/AttributeError so missing GPU/torch doesn't break the gate.",
"depends_on": [
"T1"
],
"status": "done",
"executor_notes": "Added the EmbeddedSession.run auto-flush gate. It computes model_fingerprint(api_dict), resolves VIBECOMFY_WARM over SessionConfig.warm_policy, flushes before queueing for policy never, suppresses auto-flush for always, and in auto flushes only when last_fingerprint exists, the fingerprint changed, and _free_vram_gb() is below the configured threshold. last_fingerprint is updated only after queue_prompt_api succeeds. Added _free_vram_gb() with lazy comfy.model_management import and float('inf') fallback on ImportError/AttributeError. Verified with a FakeComfy trace for same fingerprint + low VRAM, changed fingerprint + low VRAM, changed fingerprint + high VRAM, same loader + different seed, VIBECOMFY_WARM=never, and VIBECOMFY_WARM=always. Independently confirmed _free_vram_gb() returns inf when comfy.model_management is unavailable. python -m pytest tests/test_runtime_run.py and full python -m pytest passed.",
"files_changed": [
"vibecomfy/runtime/session.py"
],
"commands_run": [
"python - <<'PY' ... FakeComfy auto-flush gate trace covering auto/never/always ... PY",
"python - <<'PY'\nfrom vibecomfy.runtime.session import _free_vram_gb\nvalue = _free_vram_gb()\nprint(value)\nassert value == float('inf')\nPY",
"python -m compileall vibecomfy/runtime/session.py",
"python -m pytest tests/test_runtime_run.py",
"python -m pytest"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
}
]
code
Prior batch deviations (address if applicable):
[
"Advisory quality: skipped quality checks because post-batch git snapshot failed: Project directory is not a git repository.",
"Advisory observation skip before batch 2/7: Project directory is not a git repository.",
"Advisory observation skip after batch 2/7: Project directory is not a git repository.",
"Advisory audit skip: Project directory is not a git repository."
]
code
Batch-scoped sense checks:
[
{
"id": "SC4",
"task_id": "T3",
"question": "Are run_embedded/run_embedded_sync public signatures unchanged, does run.py re-export _embedded_configuration so commands/doctor.py:56 keeps working, and have all relocated helper bodies been deleted from run.py (only imports remain)?",
"executor_note": "Diff run.py against HEAD: helper definitions should be gone, only from vibecomfy.runtime.session import ... imports remain. from vibecomfy.runtime.run import _embedded_configuration should still resolve in a one-line REPL test.",
"verdict": ""
},
{
"id": "SC6",
"task_id": "T5",
"question": "Does ServerSession.start() spawn comfyui serve once and translate SessionConfig to the expected CLI argv (--highvram|--lowvram|--normalvram, --reserve-vram, --disable-smart-memory, --cache-classic|--cache-lru N|--cache-none, --port), and does flush() POST /api/free with {unload_models:True, free_memory:True} via the new ComfyClient.free?",
"executor_note": "Verify CLI flag translation by running the T7 argv test. Check ComfyClient.free includes the queue-async docstring. Confirm the auto-flush gate from T2 wraps ServerSession.run too (not just EmbeddedSession).",
"verdict": ""
}
]
code
Full execution tracking source of truth (`finalize.json`):
{
"tasks": [
{
"id": "T1",
"description": "Create vibecomfy/runtime/session.py and relocate shared runtime helpers from run.py. Move RunResult (run.py:19-25), _prepare_prompt (run.py:28-42), _run_metadata (run.py:76-96), _collect_output_paths (run.py:204-215), _git_sha (run.py:99-109), and the body of _embedded_configuration (run.py:163-181) into session.py \u2014 run.py imports from session.py, never the reverse. Update vibecomfy/runtime/init.py:1-11 so from vibecomfy.runtime import RunResult keeps working (re-export through run.py). Define: (a) SessionConfig dataclass with fields vram_policy/reserve_vram_gb/cache_policy/disable_smart_memory/warm_policy/auto_flush_vram_threshold_gb/port/extra. (b) Private _partition_comfy_config(d) that splits a dict into typed-field kwargs vs extra \u2014 accepts BOTH typed SessionConfig field names AND raw HiddenSwitch keys per the FLAG-012 mapping table (typed names port/vram_policy/cache_policy/warm_policy/reserve_vram_gb/disable_smart_memory/auto_flush_vram_threshold_gb route directly; raw HS keys reserve_vram\u2192reserve_vram_gb, highvram/lowvram/normalvram\u2192vram_policy, cache_none/cache_classic/cache_lru\u2192cache_policy; unknown\u2192extra). Conflict precedence: apply HS-translated keys first, then typed-name keys overwrite. (c) SessionConfig.from_dict(d) and SessionConfig.from_workflow_metadata(workflow) (delegates to from_dict on workflow.metadata.get('comfy_configuration', {})). (d) class VibeSession(Protocol) with start/run/flush/reconfigure/stop and last_fingerprint attr. (e) class EmbeddedSession(VibeSession) holding one long-lived Comfy() across calls (start instantiates Comfy with _embedded_configuration_for_session, queue_prompt_api in run, clear_cache in flush, reconfigure passes a new Configuration, stop tolerates model_mmap_residency AttributeError). (f) _embedded_configuration_for_session(config: SessionConfig) -> Configuration | None (apply order: typed fields \u2192 config.extra \u2192 VIBECOMFY_COMFY_CONFIGURATION env override; returns None if merged dict empty matching run.py:174-175). (g) _embedded_configuration(workflow) -> Configuration | None thin wrapper around _embedded_configuration_for_session(SessionConfig.from_workflow_metadata(workflow)) \u2014 preserves existing public signature. (h) Pattern-based model_fingerprint(api_dict) -> tuple \u2014 any class_type containing 'Loader' (and not in OVERRIDES_EXCLUDE), plus members of OVERRIDES_INCLUDE, contributes its non-edge string-valued input slots as sorted (class_type, slot, value) triples; OVERRIDES sets start empty.",
"depends_on": [],
"status": "done",
"executor_notes": "Created runtime/session.py with SessionConfig, VibeSession Protocol, EmbeddedSession, _embedded_configuration_for_session, _embedded_configuration workflow wrapper, model_fingerprint, and relocated RunResult/_prepare_prompt/_run_metadata/_collect_output_paths/_git_sha. Updated runtime/run.py to import relocated helpers from session.py and keep _embedded_configuration resolvable from runtime.run. Verified no reverse import from session.py to run.py, import check passed, partition conflict spot checks passed, python -m pytest tests/test_runtime_run.py passed, and full python -m pytest passed.",
"files_changed": [
"vibecomfy/runtime/session.py",
"vibecomfy/runtime/run.py"
],
"commands_run": [
"python -m compileall vibecomfy/runtime/session.py vibecomfy/runtime/run.py",
"python -c 'import vibecomfy.runtime.session; import vibecomfy.runtime.run; from vibecomfy.runtime import RunResult; print(RunResult.name)'",
"python -m pytest tests/test_runtime_run.py",
"python -m pytest"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T2",
"description": "Add the auto-flush gate inside EmbeddedSession.run in session.py. Before queueing: compute fp = model_fingerprint(api_dict). Resolve effective warm policy: os.environ.get('VIBECOMFY_WARM') overrides config.warm_policy. Behavior: 'never' \u2192 flush() then queue; 'always' \u2192 never auto-flush; 'auto' \u2192 flush iff last_fingerprint is not None and fp != last_fingerprint and _free_vram_gb() < config.auto_flush_vram_threshold_gb. After successful queue: self.last_fingerprint = fp. Add _free_vram_gb() helper that lazily imports comfy.model_management.get_free_memory() and returns float('inf') on any ImportError/AttributeError so missing GPU/torch doesn't break the gate.",
"depends_on": [
"T1"
],
"status": "done",
"executor_notes": "Added the EmbeddedSession.run auto-flush gate. It computes model_fingerprint(api_dict), resolves VIBECOMFY_WARM over SessionConfig.warm_policy, flushes before queueing for policy never, suppresses auto-flush for always, and in auto flushes only when last_fingerprint exists, the fingerprint changed, and _free_vram_gb() is below the configured threshold. last_fingerprint is updated only after queue_prompt_api succeeds. Added _free_vram_gb() with lazy comfy.model_management import and float('inf') fallback on ImportError/AttributeError. Verified with a FakeComfy trace for same fingerprint + low VRAM, changed fingerprint + low VRAM, changed fingerprint + high VRAM, same loader + different seed, VIBECOMFY_WARM=never, and VIBECOMFY_WARM=always. Independently confirmed _free_vram_gb() returns inf when comfy.model_management is unavailable. python -m pytest tests/test_runtime_run.py and full python -m pytest passed.",
"files_changed": [
"vibecomfy/runtime/session.py"
],
"commands_run": [
"python - <<'PY' ... FakeComfy auto-flush gate trace covering auto/never/always ... PY",
"python - <<'PY'\nfrom vibecomfy.runtime.session import _free_vram_gb\nvalue = _free_vram_gb()\nprint(value)\nassert value == float('inf')\nPY",
"python -m compileall vibecomfy/runtime/session.py",
"python -m pytest tests/test_runtime_run.py",
"python -m pytest"
],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T3",
"description": "Refactor run_embedded() in vibecomfy/runtime/run.py:116-156 to be a thin wrapper around EmbeddedSession.start()/run()/stop(). Public signatures of run_embedded and run_embedded_sync MUST remain unchanged. Delete the relocated helper bodies from run.py and import them from session.py. Re-export _embedded_configuration from run.py so from vibecomfy.runtime.run import _embedded_configuration continues to resolve (commands/doctor.py:56 and tests/test_runtime_run.py:116 depend on this). Verify vibecomfy/commands/doctor.py:56-60 still works without modification (it passes a VibeWorkflow, which routes through the wrapper).",
"depends_on": [
"T1",
"T2"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T4",
"description": "Create tests/test_runtime_session.py for EmbeddedSession. Reuse the sys.modules injection pattern from tests/test_runtime_run.py:140-149. FakeComfy records enter/exit counts plus queue_prompt_api/clear_cache/reconfigure call args. Required cases: (1) two sequential session.run(workflow_a) calls produce exactly one aenter/aexit pair. (2) flush() invokes clear_cache() exactly once. (3) reconfigure(SessionConfig(...)) passes a Configuration whose typed fields reflect SessionConfig. (4) from_workflow_metadata carry-through (raw HS): metadata {reserve_vram: 12, cache_none: True, fp8_e4m3fn_text_enc: True} \u2192 config.reserve_vram_gb == 12, cache_policy == 'none', extra == {fp8_e4m3fn_text_enc: True}; then _embedded_configuration_for_session yields Configuration with all three keys. (5) from_dict mirror with same raw-HS dict produces identical SessionConfig. (6) from_dict typed names: {port: 8200, vram_policy: 'high', reserve_vram_gb: 2.0, cache_policy: 'lru:3', warm_policy: 'always'} \u2192 SessionConfig(port=8200, vram_policy='high', reserve_vram_gb=2.0, cache_policy='lru:3', warm_policy='always', extra={}). (7) from_dict mixed: {port: 8200, reserve_vram: 12, fp8_e4m3fn_text_enc: True} \u2192 SessionConfig(port=8200, reserve_vram_gb=12, extra={fp8_e4m3fn_text_enc: True}). (8) typed-vs-HS conflict: {reserve_vram_gb: 2.0, reserve_vram: 12} resolves to reserve_vram_gb == 2.0. (9) empty: from_dict({}) \u2192 all defaults, empty extra. (10) Pattern-based fingerprint snapshot tests: wan_t2v.api.json (UNETLoader/CLIPLoader/VAELoader widget_0), ltx2_3_t2v.api.json (LowVRAMCheckpointLoader, LowVRAMAudioVAELoader, LTXAVTextEncoderLoader, LoraLoaderModelOnly), synthetic dict with DualCLIPLoaderGGUF/UnetLoaderGGUF \u2014 assert edge references (list values) NOT included. (11) Auto-flush truth table with mocked _free_vram_gb: same fingerprint + low VRAM \u2192 no flush; different fingerprint + low VRAM \u2192 flush; different fingerprint + high VRAM \u2192 no flush; same loader + different KSampler seed \u2192 no flush. (12) VIBECOMFY_WARM=never flushes before every run; VIBECOMFY_WARM=always never auto-flushes. Confirm existing tests/test_runtime_run.py:98-121 (test_embedded_configuration_uses_hiddenswitch_configuration_object) passes unchanged.",
"depends_on": [
"T1",
"T2",
"T3"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T5",
"description": "Add ServerSession backend in session.py. Extract subprocess startup from runtime/server.py:27-41 into _spawn_comfy_server(config: SessionConfig) -> tuple[Process, str, log_handle] in session.py. Translate SessionConfig to CLI flags: --highvram|--lowvram|--normalvram (skip when 'auto'), --reserve-vram <GB>, --disable-smart-memory, --cache-classic|--cache-lru N|--cache-none (skip when 'smart'), --port <P>. Reuse the 120-iteration /system_stats readiness loop. Add class ServerSession(VibeSession): start() calls _spawn_comfy_server; run() calls ComfyClient(self.url).queue_prompt(api_dict) wrapped by the same auto-flush gate from T2; flush() POSTs /api/free with {unload_models: True, free_memory: True}; reconfigure(config) is restart-on-change (compare CLI argv); stop() SIGTERM with 15s timeout fallback to SIGKILL. Add ComfyClient.free(unload_models, free_memory) in runtime/client.py:30+ with a one-line docstring noting queue-async semantics.",
"depends_on": [
"T1",
"T2"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T6",
"description": "Create vibecomfy/commands/session.py with argparse for start/stop/list/flush/status AND in-process daemon entrypoint (single file). Daemon invocation: python -m vibecomfy.commands.session --daemon --id NAME --config <json>. Daemon body: config_dict = json.loads(args.config); session = ServerSession(SessionConfig.from_dict(config_dict)); await session.start(); write out/sessions/<id>/{pid,url,config.json}; install SIGTERM handler that calls await session.stop() and removes pidfile; sleep on asyncio.Event. Daemonize from session start via subprocess.Popen([sys.executable, '-m', 'vibecomfy.commands.session', '--daemon', '--id', id_, '--config', json.dumps(config)], stdout=DEVNULL, stderr=open(log_path,'ab'), start_new_session=True). Parent assembles config dict from CLI flags as TYPED-NAME dict matching SessionConfig field names (omit None values): {port, vram_policy, reserve_vram_gb, cache_policy, warm_policy, disable_smart_memory}. Parent waits up to 120 s for out/sessions//url. Subcommands: start [--id NAME=default] [--vram-policy auto|high|low|normal] [--reserve-vram-gb F] [--cache-policy smart|classic|lru:N|none] [--disable-smart-memory] [--warm-policy auto|always|never] [--port P=8188], stop <id>, list, flush <id> [--unload-models/--no-unload-models] [--free-memory/--no-free-memory], status <id>. Add find_active_session(id='default') -> str | None in runtime/session.py: read out/sessions//url; if pidfile present and os.kill(pid, 0) succeeds return URL else clean up and return None. Register CommandSpec('session', 'vibecomfy.commands.session') in vibecomfy/commands/init.py:14-28 BETWEEN 'runtime' and 'logs'. Update tests/test_cli.py:25-40 to insert 'session' between 'runtime' and 'logs' in the asserted ordered list. Make warm-managed default for vibecomfy run (vibecomfy/commands/run.py): change --runtime default from 'embedded' to 'auto'; at top of _cmd_run BEFORE get_schema_provider, when args.runtime in ('auto','server') and --server-url not set, call find_active_session('default'); resolve effective runtime (auto + warm \u2192 server@URL, auto + no warm \u2192 embedded one-shot, server + warm \u2192 reuse, server + no warm \u2192 existing one-shot managed). Pass URL into both get_schema_provider('auto', server_url=session_url) AND run_sync(..., server_url=session_url, ...).",
"depends_on": [
"T5"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T7",
"description": "Add ServerSession + CLI tests. In tests/test_runtime_session.py append ServerSession tests with monkeypatched asyncio.create_subprocess_exec and stub httpx.AsyncClient. Required cases: (1) start() invokes subprocess with expected CLI argv given SessionConfig(vram_policy='high', reserve_vram_gb=2.0, cache_policy='lru:3', disable_smart_memory=True, port=8200) \u2014 assert --highvram, --reserve-vram 2.0, --cache-lru 3, --disable-smart-memory, --port 8200. (2) two session.run(...) calls share one subprocess (spawn count == 1). (3) flush() POSTs /api/free with {unload_models: True, free_memory: True}. (4) reconfigure(same_config) is a no-op; reconfigure(different_cli_args) triggers stop+start. (5) stop() SIGTERMs once, falls back to SIGKILL after 15 s. Create tests/test_session_cli.py: mock subprocess.Popen so 'daemon' is replaced by a synchronous helper that writes out/sessions//{pid,url,config.json} with synthetic alive pid. Assert: start returns 0 + creates files; list prints active id+URL; flush calls ComfyClient.free(True, True); stop removes files; find_active_session returns URL when pid alive, None (and cleans up) when pid dead. Add daemon-config carry-through tests (FLAG-012): (a) typed-name path \u2014 directly call daemon entrypoint with parsed {port:8200, vram_policy:'high', reserve_vram_gb:2.0, cache_policy:'lru:3', warm_policy:'always'} \u2192 ServerSession constructor receives SessionConfig(port=8200, vram_policy='high', reserve_vram_gb=2.0, cache_policy='lru:3', warm_policy='always', extra={}) (mock ServerSession.start to record). (b) raw HS path \u2014 {reserve_vram:12, cache_none:True, fp8_e4m3fn_text_enc:True, port:8200} \u2192 ServerSession(SessionConfig(reserve_vram_gb=12, cache_policy='none', port=8200, extra={fp8_e4m3fn_text_enc:True})). Add tests/test_runtime_run.py regression: _cmd_run with --runtime auto and a fake active session in out/sessions/default/url calls run_sync with that URL AND constructs schema provider with same URL. Add a regression case: --runtime auto with no active session falls back to embedded one-shot.",
"depends_on": [
"T6"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T8",
"description": "Update documentation. (1) Append 'Warm sessions' section to docs/runtime_lifecycle.md covering: Embedded vs Server backends, the vibecomfy session CLI (start/stop/list/flush/status), warm-policy rules (auto|always|never), /api/free queue-flag semantics (async, takes effect at next prompt boundary), VIBECOMFY_WARM env override, the pattern-based loader fingerprint (any class_type containing 'Loader' contributes non-edge string-valued slots), the SessionConfig.extra escape hatch, and the new auto default routing. (2) Append a VibeSession API block to docs/runtime_surface.md under 'Embedded Surface' (start/run/flush/reconfigure/stop + SessionConfig fields including extra). (3) Update docs/runtime_lifecycle.md:3 to reflect vibecomfy run now defaults to auto.",
"depends_on": [
"T6",
"T7"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T9",
"description": "Create scripts/warm_session_smoke.py \u2014 a manual GPU smoke script that runs two cheap workflows back-to-back through one EmbeddedSession and prints elapsed deltas. Must not be wired into automated test runs. Should print comfy.model_management.current_loaded_models length between calls (info-only) so an operator can confirm warmth.",
"depends_on": [
"T1",
"T2",
"T3"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
},
{
"id": "T10",
"description": "Run validation. Execute in this order: (1) pytest tests/test_cli.py \u2014 confirm registry assertion still passes after adding 'session'. (2) pytest tests/test_runtime_run.py \u2014 run_embedded refactor + helper relocation preserves existing behavior; test_embedded_configuration_uses_hiddenswitch_configuration_object passes via re-exported wrapper; new --runtime auto fallback case passes. (3) pytest tests/test_runtime_session.py \u2014 embedded + server session unit tests including from_workflow_metadata/from_dict partition tests and pattern-based fingerprint snapshots. (4) pytest tests/test_session_cli.py \u2014 daemon CLI flow + daemon-config carry-through (typed and raw HS paths). (5) Full pytest \u2014 confirm no collateral damage; vibecomfy/commands/doctor.py:56-60 still imports _embedded_configuration from runtime.run and passes a VibeWorkflow without modification. If any test fails, read the error, fix the code, and re-run until they pass. Do NOT create new test files beyond the two named in T4/T7. Then write a short throwaway script that reproduces the warm-session bug (create EmbeddedSession, run twice, assert FakeComfy enter/exit count == 1; or create ServerSession with mocked subprocess, run twice, assert spawn count == 1), run it to confirm the fix works, then delete it.",
"depends_on": [
"T1",
"T2",
"T3",
"T4",
"T5",
"T6",
"T7",
"T8",
"T9"
],
"status": "pending",
"executor_notes": "",
"files_changed": [],
"commands_run": [],
"auto_attributed_files": null,
"evidence_files": [],
"reviewer_verdict": ""
}
],
"watch_items": [
"FLAG-012 (must): _partition_comfy_config MUST accept BOTH typed SessionConfig field names AND raw HiddenSwitch keys in the same dict. Conflict precedence: HS-translated keys applied first, typed-name keys overwrite. The typed-vs-HS conflict test (T4 case 8) is the canonical assertion.",
"FLAG-010/callers (must): _embedded_configuration KEEPS its existing (workflow: VibeWorkflow) -> Configuration public signature. Three current callers \u2014 vibecomfy/runtime/run.py:125, tests/test_runtime_run.py:116, vibecomfy/commands/doctor.py:56-60 \u2014 MUST work without modification. The actual logic moves to _embedded_configuration_for_session(config: SessionConfig); the workflow-taking helper is a one-line wrapper. run.py re-exports it so from vibecomfy.runtime.run import _embedded_configuration keeps resolving.",
"FLAG-007/circular import: relocation direction is one-way \u2014 run.py imports from session.py, never the reverse. Verify after T1 with python -c 'import vibecomfy.runtime.session; import vibecomfy.runtime.run'.",
"FLAG-006 fingerprint scope: the extractor is PATTERN-BASED ('Loader' substring), NOT a hard-coded class list. Empty OVERRIDES_INCLUDE/OVERRIDES_EXCLUDE sets reserved for future exceptions. The synthetic-dict + ltx2_3_t2v.api.json snapshot tests in T4 are the proof.",
"Edge references (list values like ['12', 0]) on a loader node must NOT be included in the fingerprint \u2014 only non-edge string-valued slots. Test must assert this explicitly.",
"FLAG-008/test_cli.py registry: when adding CommandSpec('session', ...) between 'runtime' and 'logs', the existing exact-ordered COMMANDS assertion at tests/test_cli.py:25-40 will break unless updated in the same diff. T6 includes this update.",
"FLAG-002 warm-default: --runtime default flips from 'embedded' to 'auto'. With no warm session present, behavior MUST remain backwards-compatible (embedded one-shot). The fallback regression test in T7 covers this.",
"FLAG-004 schema-provider URL plumbing: get_schema_provider construction in _cmd_run must happen AFTER find_active_session and receive the discovered URL via server_url=session_url. Otherwise a second cold runtime would spawn for /object_info \u2014 the bug the brief explicitly calls out.",
"/api/free is QUEUE-ASYNC (sets prompt_queue.set_flag), NOT synchronous unload. Tests assert payload + endpoint, not actual model-unload completion. ComfyClient.free docstring must call this out.",
"stop() must tolerate model_mmap_residency AttributeError on Comfy.aexit (this is the cleanup path that nukes warm state at embedded_comfy_client.py:_cleanup; tolerate it on shutdown).",
"_free_vram_gb() must not crash on missing torch/comfy import \u2014 return float('inf') so the auto-flush gate is conservative on dev mac.",
"SessionConfig field-name vs raw-HS-key collision (e.g. caller passes both reserve_vram_gb=2.0 and reserve_vram=12 in one dict): apply HS-translated keys first, typed-name keys overwrite. Document in _partition_comfy_config docstring.",
"Daemon spawn uses start_new_session=True so the daemon survives parent shell exit. Pidfile + URL file land under out/sessions// with default id 'default'. Stale pidfile auto-cleanup when recorded pid is dead.",
"Auto-flush threshold default = 2.0 GB free VRAM. ServerSession default port 8188 with --port override.",
"find_active_session must clean up stale pidfile/url files when os.kill(pid, 0) raises ProcessLookupError, then return None \u2014 otherwise warm-default routing will keep trying to attach to dead daemons.",
"Manual GPU smoke (T9) cannot run on dev mac \u2014 info-only criterion. Test-layer subprocess-spawn-count + /api/free payload assertions are the actual verification gate for managed-mode warmth.",
"Existing run_embedded and run_sync public signatures MUST remain unchanged. They become thin wrappers around the new session abstraction; backwards compatibility is a hard requirement.",
"Subjective_judgment 'should' criteria \u2014 session.py under ~550 lines and docs quality in runtime_lifecycle.md/runtime_surface.md \u2014 require human inspection. Don't break them, but they're not test-gated.",
"No new runtime dependencies in pyproject.toml \u2014 httpx + stdlib only.",
"When relocating helpers, watch for imports of these names elsewhere in the codebase. Only run.py:_embedded_configuration is documented as having external callers (doctor.py + tests/test_runtime_run.py); the others (RunResult, _prepare_prompt, _run_metadata, _collect_output_paths, _git_sha) move freely. RunResult must still be importable as from vibecomfy.runtime import RunResult via init re-export.",
"Tests use the sys.modules injection pattern from tests/test_runtime_run.py:140-149 \u2014 no new test deps; pyproject.toml stays at httpx + pytest + pytest-asyncio."
],
"sense_checks": [
{
"id": "SC1",
"task_id": "T1",
"question": "Does session.py contain VibeSession Protocol, SessionConfig (with extra field), EmbeddedSession, _embedded_configuration_for_session, _embedded_configuration (workflow-taking wrapper), model_fingerprint, plus the relocated RunResult/_prepare_prompt/_run_metadata/_collect_output_paths/_git_sha \u2014 and does run.py import from session.py with no reverse import?",
"executor_note": "Confirmed session.py contains VibeSession Protocol, SessionConfig with extra, EmbeddedSession, _embedded_configuration_for_session, _embedded_configuration, model_fingerprint, and relocated RunResult/_prepare_prompt/_run_metadata/_collect_output_paths/_git_sha. run.py imports from session.py, session.py does not import run.py, and from vibecomfy.runtime import RunResult works.",
"verdict": ""
},
{
"id": "SC2",
"task_id": "T1",
"question": "Does _partition_comfy_config accept BOTH typed SessionConfig field names (port, vram_policy, cache_policy, warm_policy, reserve_vram_gb, disable_smart_memory, auto_flush_vram_threshold_gb) AND raw HiddenSwitch keys (reserve_vram, highvram/lowvram/normalvram, cache_none/cache_classic/cache_lru) in the same dict, with documented HS-first-then-typed-overwrite precedence?",
"executor_note": "Confirmed _partition_comfy_config accepts typed names and raw HiddenSwitch keys in the same dict. The implementation documents and applies HS-translated keys first, then typed-name overwrite; spot checks covered mixed input and {reserve_vram_gb: 2.0, reserve_vram: 12} resolving to reserve_vram_gb == 2.0.",
"verdict": ""
},
{
"id": "SC3",
"task_id": "T2",
"question": "Does the auto-flush gate honor VIBECOMFY_WARM (never\u2192pre-flush, always\u2192never auto-flush, auto\u2192fingerprint-change-and-low-VRAM), and does _free_vram_gb return float('inf') on import failure rather than crashing?",
"executor_note": "Confirmed the auto-flush gate honors VIBECOMFY_WARM: never flushes before every run, always never auto-flushes, and auto flushes only on model-fingerprint change under low VRAM. Confirmed _free_vram_gb returns float('inf') when comfy.model_management is unavailable.",
"verdict": ""
},
{
"id": "SC4",
"task_id": "T3",
"question": "Are run_embedded/run_embedded_sync public signatures unchanged, does run.py re-export _embedded_configuration so commands/doctor.py:56 keeps working, and have all relocated helper bodies been deleted from run.py (only imports remain)?",
"executor_note": "Diff run.py against HEAD: helper definitions should be gone, only from vibecomfy.runtime.session import ... imports remain. from vibecomfy.runtime.run import _embedded_configuration should still resolve in a one-line REPL test.",
"verdict": ""
},
{
"id": "SC5",
"task_id": "T4",
"question": "Do the embedded-session tests cover all 12 required cases (sequential-runs single enter/exit, flush, reconfigure, from_workflow_metadata raw HS, from_dict raw HS mirror, from_dict typed names, from_dict mixed, typed-vs-HS conflict, empty, pattern-based fingerprint snapshots \u00d7 3, auto-flush truth table, VIBECOMFY_WARM=never/always) \u2014 including the explicit assertion that edge references (list values) are NOT included in the fingerprint?",
"executor_note": "Run pytest tests/test_runtime_session.py -v and grep the test names against the 12-case checklist. The edge-reference exclusion test is easy to forget \u2014 confirm it appears as its own assertion line.",
"verdict": ""
},
{
"id": "SC6",
"task_id": "T5",
"question": "Does ServerSession.start() spawn comfyui serve once and translate SessionConfig to the expected CLI argv (--highvram|--lowvram|--normalvram, --reserve-vram, --disable-smart-memory, --cache-classic|--cache-lru N|--cache-none, --port), and does flush() POST /api/free with {unload_models:True, free_memory:True} via the new ComfyClient.free?",
"executor_note": "Verify CLI flag translation by running the T7 argv test. Check ComfyClient.free includes the queue-async docstring. Confirm the auto-flush gate from T2 wraps ServerSession.run too (not just EmbeddedSession).",
"verdict": ""
},
{
"id": "SC7",
"task_id": "T6",
"question": "Is the daemon entrypoint a single file at vibecomfy/commands/session.py invokable via python -m vibecomfy.commands.session --daemon --id NAME --config <JSON>, does the parent assemble the typed-name config dict, does vibecomfy run --runtime auto thread the discovered URL into BOTH get_schema_provider AND run_sync, and is tests/test_cli.py:25-40 updated to include 'session' between 'runtime' and 'logs'?",
"executor_note": "Inspect run.py _cmd_run to confirm find_active_session is called BEFORE get_schema_provider, with the URL passed to both call sites. Run pytest tests/test_cli.py \u2014 if the registry assertion fails, the test wasn't updated.",
"verdict": ""
},
{
"id": "SC8",
"task_id": "T7",
"question": "Do the ServerSession + CLI tests assert spawn count == 1 across two runs, /api/free payload, daemon-config carry-through for BOTH typed-name and raw-HS JSON shapes, AND the auto-default fallback behavior (warm session attaches; no warm session falls back to embedded one-shot)?",
"executor_note": "Spot-check the FLAG-012 daemon test specifically \u2014 it must have two sub-cases (typed-name and raw-HS) with the constructor argument captured via a mock. Confirm the no-active-session fallback test exercises embedded one-shot rather than failing.",
"verdict": ""
},
{
"id": "SC9",
"task_id": "T8",
"question": "Do docs/runtime_lifecycle.md and docs/runtime_surface.md cover both backends, the session CLI, warm-policy rules, /api/free queue-async semantics, VIBECOMFY_WARM, the pattern-based fingerprint, the SessionConfig.extra escape hatch, and the new auto default?",
"executor_note": "Read both docs end-to-end. The /api/free queue-async note and the SessionConfig.extra escape-hatch note are easy to forget \u2014 grep for both keywords.",
"verdict": ""
},
{
"id": "SC10",
"task_id": "T9",
"question": "Does scripts/warm_session_smoke.py exercise EmbeddedSession (not ServerSession) so the second-call timing actually reflects in-process model warmth, and does it print current_loaded_models length between calls?",
"executor_note": "Embedded backend is mandated because ServerSession returns after queue submission and can't measure actual warmth. Confirm the script imports EmbeddedSession and not ServerSession.",
"verdict": ""
},
{
"id": "SC11",
"task_id": "T10",
"question": "Does the full pytest suite pass, including the ordered validation steps (test_cli first, then test_runtime_run, test_runtime_session, test_session_cli, then full pytest), and was a throwaway repro script run to confirm the warm-session fix and then deleted?",
"executor_note": "Capture each pytest invocation's exit status. The throwaway repro script must be deleted after the run \u2014 verify with git status showing no new untracked files outside the planned set.",
"verdict": ""
}
],
"meta_commentary": "Plan size is large (~10 tasks across three phases). Recommended execution order matches plan validation order: Phase 1 first (T1\u2192T2\u2192T3\u2192T4), then Phase 2 (T5\u2192T6\u2192T7), then docs (T8) and smoke (T9), then T10 to validate. Critical correctness traps to remember while executing: (1) The _partition_comfy_config dual-vocabulary contract is the single most-flagged correctness item across five gate iterations \u2014 both typed SessionConfig field names AND raw HiddenSwitch keys must be accepted in one dict; the typed-vs-HS conflict test (T4 case 8) and the daemon carry-through test (T7) are the canonical assertions. Get this wrong and the FLAG-012 work was wasted. (2) _embedded_configuration MUST keep its (workflow: VibeWorkflow) -> Configuration signature unchanged. The new logic lives in _embedded_configuration_for_session(SessionConfig); the workflow-taking helper is a one-line wrapper that routes through SessionConfig.from_workflow_metadata. Don't change the public signature. (3) Helper relocation is one-way (run.py imports session.py, never the reverse). The circular import was specifically called out and resolved \u2014 don't reintroduce it. (4) Pattern-based fingerprint, NOT a hard-coded class list. Anything containing 'Loader' (and not in OVERRIDES_EXCLUDE) qualifies. Edge references (list values) are excluded \u2014 string values only. (5) Warm-default routing: --runtime default flips from 'embedded' to 'auto'. The schema-provider URL must be threaded BEFORE get_schema_provider construction so a second cold runtime doesn't spawn for /object_info. Both run_sync AND get_schema_provider receive the same URL. (6) test_cli.py:25-40 has an exact-ordered COMMANDS assertion \u2014 it WILL break when 'session' is registered unless updated in the same change. (7) /api/free is queue-async; tests assert payload, not synchronous unload completion. (8) Daemon spawn uses start_new_session=True; pidfile + URL files under out/sessions//. find_active_session cleans up stale pidfiles when os.kill(pid, 0) raises. (9) GPU smoke (T9) is info-only; the dev mac can't run it. The test layer (spawn count == 1 + /api/free payload) is the real warmth-verification gate. Read tests/test_runtime_run.py:140-149 first to copy the sys.modules injection pattern \u2014 all new tests use it. The plan went through 5 critique iterations; trust the settled decisions in the plan body and don't second-guess them.",
"validation": {
"plan_steps_covered": [
{
"plan_step_summary": "Step 1: Create vibecomfy/runtime/session.py with VibeSession Protocol, SessionConfig (with extra + from_dict + from_workflow_metadata + dual-vocabulary _partition_comfy_config), EmbeddedSession, _embedded_configuration_for_session, _embedded_configuration wrapper, pattern-based model_fingerprint; relocate shared runtime helpers from run.py; update runtime/init.py re-export",
"finalize_task_ids": [
"T1"
]
},
{
"plan_step_summary": "Step 2: Add auto-flush gate inside EmbeddedSession.run with VIBECOMFY_WARM override and _free_vram_gb helper",
"finalize_task_ids": [
"T2"
]
},
{
"plan_step_summary": "Step 3: Refactor run_embedded into one-shot wrapper around EmbeddedSession; delete relocated helper bodies from run.py; re-export _embedded_configuration",
"finalize_task_ids": [
"T3"
]
},
{
"plan_step_summary": "Step 4: Tests for embedded session \u2014 sequential-runs warmth, flush, reconfigure, from_workflow_metadata + from_dict partition tests (raw-HS, typed-name, mixed, conflict, empty), pattern-based fingerprint snapshots, auto-flush truth table, VIBECOMFY_WARM cases",
"finalize_task_ids": [
"T4"
]
},
{
"plan_step_summary": "Step 5: ServerSession backend with _spawn_comfy_server CLI-flag translation, /api/free flush, restart-on-change reconfigure, SIGTERM/SIGKILL stop; ComfyClient.free helper",
"finalize_task_ids": [
"T5"
]
},
{
"plan_step_summary": "Step 6: Daemon CLI vibecomfy/commands/session.py (start/stop/list/flush/status + --daemon entrypoint), find_active_session, register CommandSpec, update tests/test_cli.py registry assertion, change vibecomfy run --runtime default to auto with URL threading into get_schema_provider AND run_sync",
"finalize_task_ids": [
"T6"
]
},
{
"plan_step_summary": "Step 7: Tests for ServerSession (subprocess argv, spawn-count==1, flush payload, reconfigure no-op vs restart, SIGTERM\u2192SIGKILL) + CLI (start/stop/list/flush, find_active_session pid-alive/dead, daemon-config carry-through for typed and raw-HS shapes) + auto-default routing regression in test_runtime_run.py",
"finalize_task_ids": [
"T7"
]
},
{
"plan_step_summary": "Step 8: Append Warm sessions section to docs/runtime_lifecycle.md and VibeSession API block to docs/runtime_surface.md; update docs/runtime_lifecycle.md:3 to reflect auto default",
"finalize_task_ids": [
"T8"
]
},
{
"plan_step_summary": "Step 9: Add scripts/warm_session_smoke.py manual GPU smoke using EmbeddedSession with elapsed deltas + current_loaded_models inspection",
"finalize_task_ids": [
"T9"
]
},
{
"plan_step_summary": "Validation: ordered pytest runs (test_cli, test_runtime_run, test_runtime_session, test_session_cli, full pytest) + throwaway repro script",
"finalize_task_ids": [
"T10"
]
}
],
"orphan_tasks": [],
"completeness_notes": "All 9 plan steps map to dedicated tasks T1\u2013T9; T10 covers the plan's 5-step validation order plus the throwaway-repro requirement. The only plan content not broken into a separate task is the validation order itself, which is consolidated inside T10 (the executor must run the steps in the listed order so registry/refactor failures surface first). The 'should' subjective criteria (line-count cap, doc quality, no new deps) are tracked in watch_items rather than as separate tasks because they're cross-cutting checks during T1/T8.",
"coverage_complete": true
},
"baseline_test_failures": [],
"baseline_test_command": "pytest --tb=no -q --no-header",
"baseline_test_note": "Baseline not run during finalize (this is a planning-only step). T10 begins with the ordered validation sequence: pytest tests/test_cli.py \u2192 pytest tests/test_runtime_run.py \u2192 pytest tests/test_runtime_session.py \u2192 pytest tests/test_session_cli.py \u2192 full pytest. The executor should snapshot a baseline pytest run BEFORE starting T1 to identify any pre-existing failures that should be ignored, then ensure no new failures are introduced."
}
code
Debt watch items (do not make these worse):
[DEBT] are-the-proposed-changes-technically-correct: are the proposed changes technically correct?: for ordinary pairs, the new diagnosis is not well-supported by the repo. the current sync effect in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/tools/travel-between-images/components/shotimageseditor/hooks/usesegmentslotmode.ts already syncs url and primaryvariantid, and the regenerate path reads exactly starturl, endurl, startgenid, endgenid, startvariantid, and endvariantid from segmentslotmode.pairdata in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/domains/media-lightbox/hooks/usevideoregeneratemode.ts. adding thumburl and generationid to the sync does not, by itself, explain why an old image url is still being used for regular pairs. (flagged 1 times across 1 plans)
[DEBT] are-the-proposed-changes-technically-correct: are the proposed changes technically correct?: the fix is incomplete for extra trailing slots. handlepairclick can populate activepairdata from trailingpairdata when pairindex === pairdatabyindex.size in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/tools/travel-between-images/components/shotimageseditor/hooks/usesegmentslotmode.ts, but the proposed sync effect only reads pairdatabyindex.get(segmentslotlightboxindex). for those trailing-slot cases fresh is undefined, so no image refresh happens. (flagged 1 times across 1 plans)
[DEBT] are-the-proposed-changes-technically-correct: are the proposed changes technically correct?: the merge pseudocode does not actually sync 'all image fields' as claimed. it omits id and position from change detection, and when fresh.startimage or fresh.endimage becomes null it preserves the stale previous object instead of syncing that null state. as written, it also needs explicit null-guards around spreads of prev.startimage / prev.endimage to be safe in strict typescript. (flagged 1 times across 1 plans)
[DEBT] are-the-proposed-changes-technically-correct: are the proposed changes technically correct?: the plan's claim that worker_state.py:200-204 (the 30-minute startup safety net) catches abandoned pods that exited before patching is slightly imprecise. line 200-204 only runs when in_startup_phase is true, which requires startup_phase to be in ('deps_installing', 'deps_verified', 'worker_starting') per line 161. a pod that exits before its first patch has startup_phase = none, so in_startup_phase is false and the code falls through to the normal timeout checks (active_stale / not_claiming) at line 207+, not the 30-minute startup cap. both paths eventually reap the worker, so the end result is the same, but the overview's reasoning (naming 200-204 specifically) is wrong. worth correcting so future readers don't mis-reason about the invariant. (flagged 1 times across 1 plans)
[DEBT] are-the-proposed-changes-technically-correct: are the proposed changes technically correct?: checked worker_state.py line 161 (in_startup_phase = startup_phase in (...)) against the plan's assumption that subsequent lenient writes are safe. if deps_installing succeeds but deps_verified silently fails, startup_phase stays at 'deps_installing' and the 30-minute cap from line 200-204 applies — even though the pod is actually progressing through uv sync. on a slow runpod image with cold wheel downloads, uv sync --extra cuda124 plus wan2gp deps can take 20+ minutes. there's no concrete benchmark in the plan that says the 30-minute cap is safely above the expected sync time; if uv sync legitimately takes 25 minutes and the deps_verified patch fails on a transient network blip, the orchestrator will terminate a healthy pod. plan should either bump the cap or note that deps_verified swallowing is acceptable because the cap is generously above typical sync time. (flagged 1 times across 1 plans)
[DEBT] are-the-proposed-changes-technically-correct: are the proposed changes technically correct?: the path-mapping defect from the previous iteration is fixed, but a different technical gap remains around self_refiner. repository search shows shared.utils.self_refiner is imported by wan2gp/wgp.py, wan2gp/models/ltx2/ltx_pipelines/distilled.py, ti2vid_one_stage.py, ti2vid_two_stages.py, wan2gp/models/ltx2/ltx_pipelines/utils/helpers.py, and wan2gp/models/wan/any2video.py; the v4 plan still aligns wan2gp/shared/utils/self_refiner.py to upstream head without any concrete runtime step that exercises those code paths after the change, so the only repo-documented behavior check for that file is still missing from the executable body. (flagged 1 times across 1 plans)
[DEBT] are-the-success-criteria-well-prioritized-and-verifiable: are the success criteria well-prioritized and verifiable?: the attached success criteria are stale and do not match the current plan body. they still require 'no usestate for activepairdata', 'setactivepairdata fully removed', 'sync effect deleted', and 'onpairclick simplified to (pairindex: number) => void', which are the opposite of the current targeted-sync plan. as presented, the criteria are not usable for review or execution. (flagged 1 times across 1 plans)
[DEBT] audio-loading: getaudiodata in useeffect removes render-readiness signal (flagged 1 times across 1 plans)
[DEBT] audio-loading: same as correctness-3 — preview/render parity risk (flagged 1 times across 1 plans)
[DEBT] audio-loading: preview/render parity partially satisfied (flagged 1 times across 1 plans)
[DEBT] audio-reactivity: overlapping clips use first-found, volume not scaled (flagged 1 times across 1 plans)
[DEBT] audio-reactivity: same as audio-reactivity-1 — overlapping/volume-adjusted clips diverge from audible mix (flagged 1 times across 1 plans)
[DEBT] audio-reactivity: textclip missing globalframeprovider (flagged 1 times across 1 plans)
[DEBT] audio-reactivity: same as audio-reactivity-2 — textclipsequence missing provider (flagged 1 times across 1 plans)
[DEBT] audio-reactivity: textclip effects surface not covered (flagged 1 times across 1 plans)
[DEBT] audio-reactivity: continuous effects shared by visual and text clips (flagged 1 times across 1 plans)
[DEBT] batch-generation-pipeline: enhancement in usegeneratebatch before generatevideo() could compute prompts against a stale pair snapshot if mutations are still in flight. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-cascade-paths: cascade lookup only reads params->>'orchestrator_task_id_ref', missing shared reference paths and orchestrator-self detection. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-cascade-paths: duplicate of correctness-2 + correctness-3: invalid sql syntax and narrow cascade lookup. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-cascade-paths: shared orchestrator-reference helpers not referenced. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-cascade-paths: orchestrator tasks that crash don't get orchestrator-self cascade. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-cascade-paths: hardcoded params->>'orchestrator_task_id_ref' misses other reference paths. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-retry: crash requeue sql does not increment attempts, risking infinite requeue loop. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-retry: duplicate of correctness-1: attempts never advance on crash requeue. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-retry: missing attempts increment location in heartbeat sql. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-retry: step 6 under-scoped for real retry convergence and orchestrator-self handling. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-sql-syntax: bare select inside plpgsql is invalid — needs perform. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-testing: no multi-crash convergence test exercising attempts 0→1→2→3. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-testing: no validation that plpgsql body executes successfully. (flagged 1 times across 1 plans)
[DEBT] crash-recovery-testing: criteria don't require proof of crash requeue convergence. (flagged 1 times across 1 plans)
[DEBT] criteria-verifiability: 'no unsafe .maybesingle()' criterion requires judgment about column uniqueness. (flagged 1 times across 1 plans)
[DEBT] criteria-verifiability: decision documentation location not specified. (flagged 1 times across 1 plans)
[DEBT] criteria-verifiability: the must criterion requiring 5 task types to exist as active db rows is not verifiable from code diff alone — it requires a live db query. (flagged 1 times across 1 plans)
[DEBT] db-fallback-testing: no new automated test for the db fallback dispatch path or dependant_on preservation for raw worker families. (flagged 1 times across 1 plans)
[DEBT] dependency-resolution: dependency resolution: the plan does not lock down the active python-version matrix even though the repo currently splits between python 3.10 local installs and a python 3.11 runpod image. (flagged 1 times across 1 plans)
[DEBT] did-the-work-fully-address-the-issue-hints-user-notes-and-approved-plan-requirements: did the work fully address the issue hints, user notes, and approved plan requirements?: the package is internally inconsistent. the plan body says to keep activepairdata in usestate and make phase 2 optional, but the attached metadata and success criteria still describe the previous derive-via-usememo / remove-setactivepairdata / simplify-onpairclick plan. that means the approved-plan requirements are only partially coherent as presented. (flagged 1 times across 1 plans)
[DEBT] did-the-work-fully-address-the-issue-hints-user-notes-and-approved-plan-requirements: did the work fully address the issue hints, user notes, and approved plan requirements?: the linux distro note is documentation-only; the generated install command in step 7 still runs apt-get install python3.10-venv python3.10-dev ffmpeg without any pre-check that the package exists. users on ubuntu 24.04+ who ignore the doc and try to copy-paste the command will hit a confusing e: unable to locate package python3.10-venv from apt rather than a targeted error from commandutils.ts. a one-line detection pre-check (e.g., apt-cache show python3.10-venv >/dev/null 2>&1 || { echo 'install deadsnakes ppa first — see readme'; exit 1; }) would convert the silent failure into an actionable error, but the plan does not add this. (flagged 1 times across 1 plans)
[DEBT] did-the-work-fully-address-the-issue-hints-user-notes-and-approved-plan-requirements: did the work fully address the issue hints, user notes, and approved plan requirements?: checked the revised v4 body against docs/wan2gp_fork_migration_plan.md sprint 2. the repo plan doc still lists an "ltx-2 self_refiner smoke against the pre-sprint behavioral baseline" as a sprint 2 verification gate and repeats that smoke in the functionality-preservation checks, but the revised execution steps no longer schedule that smoke anywhere; it survives only as an info-level metadata criterion. because wan2gp/shared/utils/self_refiner.py remains an explicit sprint 2 deliverable, the revised plan still only partially carries forward the verification package described in the source migration plan. (flagged 1 times across 1 plans)
[DEBT] does-the-change-touch-all-locations-and-supporting-infrastructure: does the change touch all locations and supporting infrastructure?: phase 1 still misses a real supporting-data location: trailingpairdata lives outside pairdatabyindex in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/tools/travel-between-images/components/shotimageseditor/hooks/usesegmentslotpresentationadapter.ts, but the proposed sync logic only considers pairdatabyindex. if trailing slot regenerate is part of the bug surface, that location is not covered. (flagged 1 times across 1 plans)
[DEBT] does-the-change-touch-all-locations-and-supporting-infrastructure: does the change touch all locations and supporting infrastructure?: the non-swallowing helper update_worker_phase_strict is a new shell function, but phase 1 step 2 introduces it only as pseudo-code. there is no concrete note that the helper must handle supabase http non-2xx responses as failures (curl returns 0 even on http 4xx/5xx by default unless -f or --fail-with-body is used). if the implementer ports update_worker_phase verbatim with only || return 0 removed, a 500 from supabase would still report success because curl's exit code is 0. the plan should specify curl --fail or explicit http status code checking in the strict variant. (flagged 1 times across 1 plans)
[DEBT] does-the-change-touch-all-locations-and-supporting-infrastructure: does the change touch all locations and supporting infrastructure?: the supporting-infrastructure review still finds one missing check. in docs/wan2gp_fork_migration_plan.md, sprint 2's verification matrix and risk register both single out self_refiner as a distinct drift-upgrade surface with its own smoke and its own silent-behavior-change risk, but the revised v4 body updates the file without keeping that supporting verification step in the actual execution checklist. (flagged 1 times across 1 plans)
[DEBT] edge-test-config: plan's vitest commands use the wrong config entry point. (flagged 1 times across 1 plans)
[DEBT] edge-test-config: same as verification-3: wrong vitest config in validation commands. (flagged 1 times across 1 plans)
[DEBT] edge-test-config: success criterion references wrong test command. (flagged 1 times across 1 plans)
[DEBT] error-handling: db loader error handling convention mismatch (plan says log+null, existing loaders throw) (flagged 1 times across 1 plans)
[DEBT] error-propagation-logging: generation.ts and handler.ts logging endpoints are not directly tested. (flagged 1 times across 1 plans)
[DEBT] error-propagation-testing: no end-to-end regression test for the full symptom chain (db error → tocompletionerror metadata → handler log). (flagged 1 times across 1 plans)
[DEBT] error-propagation-testing: handler.ts metadata surfacing criterion lacks a concrete automated verifier. (flagged 1 times across 1 plans)
[DEBT] error-propagation-testing: main issue only partially validated without an integration test. (flagged 1 times across 1 plans)
[DEBT] find-the-callers-of-the-changed-function-what-arguments-do-they-actually-pass-does-the-fix-handle-all-of-them: find the callers of the changed function. what arguments do they actually pass? does the fix handle all of them?: the step 2 retry loop uses a naked sleep 2 between attempts, which adds up to 6 seconds of latency on the happy path when the first patch eventually succeeds on attempt 2 or 3. for pods where supabase is reachable but slow during the initial moments of a cold runpod start, the retry logic is fine. however, if the first attempt fails with a tls handshake delay and the retry loop sleeps 2s per attempt regardless of whether curl itself has been blocking for tens of seconds, the total startup latency penalty could be substantial. this is a minor tuning concern, not a correctness issue. (flagged 1 times across 1 plans)
[DEBT] find-the-callers-of-the-changed-function-what-arguments-do-they-actually-pass-does-the-fix-handle-all-of-them: find the callers of the changed function. what arguments do they actually pass? does the fix handle all of them?: finding callers of the changed module shows that shared.utils.self_refiner is consumed by wan2gp/wgp.py, wan2gp/models/ltx2/ltx2_handler.py, multiple ltx2 pipeline modules, and wan2gp/models/wan/any2video.py. the revised validation steps still only drive the three bridge getters in source/runtime/wgp_ports/vendor_imports.py; none of the scheduled commands execute a real self_refiner caller, so the plan does not yet verify the main caller shapes for the other explicit sprint 2 file change. (flagged 1 times across 1 plans)
[DEBT] gpu-branching-test-matrix: linux cuda128 path under-verified (flagged 1 times across 1 plans)
[DEBT] gpu-branching-ui-surface: nvidia-50 option is exposed on linux in the ui but linux cuda128 smoke test is missing (flagged 1 times across 1 plans)
[DEBT] hook-abstraction: usepairsettingshandler becomes trivial with single caller — keeping it is extra indirection. (flagged 1 times across 1 plans)
[DEBT] is-the-change-in-the-right-place-and-would-it-break-any-callers: is the change in the right place, and would it break any callers?: the optional cleanup steps are not in the right place yet. pairregionslayer does not receive pairdatabyindex today; its props are only images, imagepositionswithpending, pairinfowithpending, and callback/display props in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/tools/travel-between-images/components/timeline/timelinecontainer/components/pairregionslayer.tsx. so step 4's 'pass pairdatabyindex.get(pairindex) directly' would require new prop plumbing or a different seam. (flagged 1 times across 1 plans)
[DEBT] is-the-scope-and-scale-of-the-change-appropriate: is the scope and scale of the change appropriate?: phase 2 is still under-specified for execution. step 4 says pairregionslayer should either pass pairdatabyindex.get(pairindex) directly or 'just pass the index + frame-only data', which are materially different designs. if phase 2 is kept in the plan, it needs a single concrete direction. (flagged 1 times across 1 plans)
[DEBT] is-there-convincing-verification-for-the-change: is there convincing verification for the change?: the plan still lacks an explicit automated regression test for the reported bug. step 2 is manual ('check that usevideoregeneratemode now gets the fresh url'), but there is no concrete test that opens a segment slot, changes the primary variant data, and asserts that the regenerate path sees the fresh url, generationid, and primaryvariantid. (flagged 1 times across 1 plans)
[DEBT] is-there-convincing-verification-for-the-change: is there convincing verification for the change?: the current usesegmentslotmode test remains only a smoke test in /users/user_c042661f/documents/reigh-workspace/reigh-app/src/tools/travel-between-images/components/shotimageseditor/hooks/tests/usesegmentslotmode.test.ts, and the plan does not add behavior coverage for the new sync effect. (flagged 1 times across 1 plans)
[DEBT] is-there-convincing-verification-for-the-change: is there convincing verification for the change?: no verification step covers the trailing-slot branch, even though the proposed phase 1 logic currently misses trailingpairdata refreshes. (flagged 1 times across 1 plans)
[DEBT] legacy-data-backfill: the step 8 diagnostic query only detects cross-shot pair_shot_generation_id misassociations, not same-shot misassociations caused by timeline reordering within a shot. (flagged 1 times across 1 plans)
[DEBT] lookup-consistency: other repo call sites use unordered .limit(1).maybesingle() and will remain inconsistent. (flagged 1 times across 1 plans)
[DEBT] lookup-consistency: other call sites with same unsafe pattern not covered. (flagged 1 times across 1 plans)
[DEBT] lora-management: lora tools simplified vs full ui parity (multi-stage metadata, private loras) (flagged 1 times across 1 plans)
[DEBT] media-lightbox-persistence: variant switches do not clear/restore inpaintprompt, so stale prompt state can leak across variants with no cached prompt. (flagged 1 times across 1 plans)
[DEBT] media-lightbox-persistence: removing prompt/numgenerations from the variant-keyed localstorage cache means all variants within a generation share the same prompt. this broadens existing debt-002 (variant prompt leakage). (flagged 1 times across 1 plans)
[DEBT] media-lightbox-segment-slot: media lightbox / segment slot: the targeted sync rationale does not fully explain the reported stale-url bug for regular pairs, and the proposed effect still misses trailing-slot refreshes because those can come from trailingpairdata rather than pairdatabyindex. (flagged 1 times across 1 plans)
[DEBT] number-input-nullable: plan doesn't explicitly state onchange must also accept null, though step 3 depends on it. (flagged 1 times across 1 plans)
[DEBT] number-input-nullable: disputed v1 flag — original concern about bulkclippanel being unimplementable. (flagged 1 times across 1 plans)
[DEBT] number-input-nullable: onchange null filtering not explicitly addressed in plan. (flagged 1 times across 1 plans)
[DEBT] number-input-testing: no planned tests for numberinput shared component or bulkclippanel nullable draft flow. (flagged 1 times across 1 plans)
[DEBT] orchestrator-completion-rollout: pre-existing individual_travel_segment children won't drive orchestrator completion through segment_type_config after deploy. (flagged 1 times across 1 plans)
[DEBT] orchestrator-completion-rollout: missing compatibility seam in orchestratorcore.ts:123-126 for old individual_travel_segment rows. (flagged 1 times across 1 plans)
[DEBT] orchestrator-completion-rollout: mixed old/new data during rollout can leave old orchestrators without completion counting. (flagged 1 times across 1 plans)
[DEBT] orchestrator-completion-rollout: no test or deployment guard for pre-existing individual_travel_segment children completing after worker change. (flagged 1 times across 1 plans)
[DEBT] orchestrator-completion-rollout: plan overstates backward compatibility for existing data. (flagged 1 times across 1 plans)
[DEBT] orchestrator-completion-rollout: missing rollout compatibility step for in-flight individual_travel_segment tasks. (flagged 1 times across 1 plans)
[DEBT] orchestrator-completion-rollout: pre-deploy individual_travel_segment child completing post-rollout won't be treated as segment task by checkorchestratorcompletion. (flagged 1 times across 1 plans)
[DEBT] orchestrator-completion-rollout: orchestrator.test.ts criterion too narrow to verify old individual_travel_segment compatibility. (flagged 1 times across 1 plans)
[DEBT] pair-settings-plumbing: handleopenpairsettings(pairindex, pairframedata) path in timelinetrackprelude, segmentoutputstrip, and usesegmentoutputstrip not explicitly named. (flagged 1 times across 1 plans)
[DEBT] pair-settings-plumbing: same as flag-002 — segmentoutputstrip and usesegmentoutputstrip still carry pairframedata. (flagged 1 times across 1 plans)
[DEBT] pair-settings-plumbing: timelinetrackprelude and segmentoutputstrip still forward (pairindex, pairframedata). (flagged 1 times across 1 plans)
[DEBT] plan-scope: step 3 is larger than a light megaplan warrants. (flagged 1 times across 1 plans)
[DEBT] planning-metadata: planning metadata: the attached metadata and success criteria still describe a different implementation than the current plan body, which risks sending execution and review down the wrong path. (flagged 1 times across 1 plans)
[DEBT] planning-metadata: success criteria don't cover wave 4 scope (flagged 1 times across 1 plans)
[DEBT] position-key-semantics: plan investigates a unique constraint on (parent_generation_id, child_order) which doesn't match repo semantics for position keys. (flagged 1 times across 1 plans)
[DEBT] position-key-semantics: plan weights toward child_order rather than pair_shot_generation_id as the key that matters. (flagged 1 times across 1 plans)
[DEBT] position-key-semantics: unique constraint on (parent_generation_id, child_order) not supported by repo semantics. (flagged 1 times across 1 plans)
[DEBT] prompt-composition: the plan's step 1 signature includes textbeforeprompts/textafterprompts parameters that would be applied before enhancement, double-wrapping the prompt. (flagged 1 times across 1 plans)
[DEBT] ready-template-snapshots: step 4.2 drops markdownnote nodes but step 4.5 and the success criteria require class_type/widget parity with pre-refactor snapshots, which currently include markdownnote nodes. (flagged 1 times across 1 plans)
[DEBT] ready-template-snapshots: same tension as issue_hints v2: drop-markdownnote vs. snapshot parity. (flagged 1 times across 1 plans)
[DEBT] search-for-related-code-that-handles-the-same-concept-is-the-reported-issue-a-symptom-of-something-broader: search for related code that handles the same concept. is the reported issue a symptom of something broader?: checked the broader runtime surface after the v4 path fix. sprint 2 is still moving two behavior-sensitive seams rather than just the import-path contract: the wan2gp/ mount path and the self_refiner runtime. step 6.2 covers only the three vendor_imports getters, while the 6-file travel suite and the bridge-contract tests do not mention self_refiner, so dropping the dedicated self-refiner smoke from the runnable steps leaves the broader downstream surface of that changed file under-covered. (flagged 1 times across 1 plans)
[DEBT] self-refiner-verification: self-refiner verification: the revised plan still aligns wan2gp/shared/utils/self_refiner.py without scheduling the sprint 2 ltx-2 self_refiner smoke that docs/wan2gp_fork_migration_plan.md defines as the behavior-preservation check for that drift upgrade. (flagged 1 times across 1 plans)
[DEBT] settings-defaults: workerrepopath default can go stale if user switches computertype before editing path (flagged 1 times across 1 plans)
[DEBT] settings-resolution: settings cascade missing — shot-only read diverges from form's defaults→user→project→shot merge (flagged 1 times across 1 plans)
[DEBT] settings-resolution: settings cascade missing — shot-only read (flagged 1 times across 1 plans)
[DEBT] shared-component-compatibility: numberinput changes affect callers outside video-editor (billing, travel-between-images, phaseconfigselectormodal). (flagged 1 times across 1 plans)
[DEBT] shared-component-compatibility: shared ui component blast radius not audited in plan. (flagged 1 times across 1 plans)
[DEBT] shot-linking-testing: no test covers the linkgenerationtoshot error/catch branches. (flagged 1 times across 1 plans)
[DEBT] signature-propagation: plan doesn't explicitly name timeline/index.tsx and segmentslotcontracts.ts for updates. (flagged 1 times across 1 plans)
[DEBT] signature-propagation: same as flag-001 — timeline/index.tsx and segmentslotcontracts.ts not in checklist. (flagged 1 times across 1 plans)
[DEBT] signature-propagation: five supporting contract/plumbing sites not named in the checklist. (flagged 1 times across 1 plans)
[DEBT] task-types-verification: step 3 cites wrong migration file (task_cost_configs instead of task_types) as evidence for db fallback path. (flagged 1 times across 1 plans)
[DEBT] task-types-verification: step 3 should cite task_types source, not task_cost_configs. (flagged 1 times across 1 plans)
[DEBT] task-types-verification: plan doesn't verify travel_segment and travel_stitch exist as active task_types rows using the correct table. (flagged 1 times across 1 plans)
[DEBT] test-coverage: current generation-child.test.ts is only a smoke test. (flagged 1 times across 1 plans)
[DEBT] test-coverage: no plan to verify other lookup paths choose rows consistently. (flagged 1 times across 1 plans)
[DEBT] test-coverage: no new tests for db loader or travel param merge path (flagged 1 times across 1 plans)
[DEBT] test-coverage: must-level criteria depend on manual testing rather than automated assertions (flagged 1 times across 1 plans)
[DEBT] test-coverage: no new unit tests for wave 4 tools (flagged 1 times across 1 plans)
[DEBT] test-coverage: must criteria backed by manual testing only (flagged 1 times across 1 plans)
[DEBT] test-infrastructure: no test fixtures for resources table (flagged 1 times across 1 plans)
[DEBT] timeline-drag-coordination: plan keeps two hooks instead of a single coordinator (flagged 1 times across 1 plans)
[DEBT] timeline-drag-coordination: brief says single coordinator but plan keeps separate hooks (flagged 2 times across 1 plans)
[DEBT] timeline-drag-coordination: pendingopsref retained despite brief suggesting removal (flagged 1 times across 1 plans)
[DEBT] timeline-drag-coordination: wrapper-bound listener mount wiring under-specified (flagged 1 times across 1 plans)
[DEBT] timeline-persistence: read path still assembles config and registry from separate requests (flagged 1 times across 1 plans)
[DEBT] timeline-persistence: poll sync verification not structurally changed (flagged 1 times across 1 plans)
[DEBT] timeline-persistence: backend save helpers not wired to new rpc (flagged 1 times across 1 plans)
[DEBT] timeline-persistence: read infrastructure not updated (flagged 1 times across 1 plans)
[DEBT] timeline-persistence: backend tests not in validation list (flagged 1 times across 1 plans)
[DEBT] timeline-persistence: backend callers not migrated (flagged 1 times across 1 plans)
[DEBT] timeline-persistence: broader persistence-contract problem (flagged 1 times across 1 plans)
[DEBT] timeline-persistence: backend split-save not addressed (flagged 1 times across 1 plans)
[DEBT] timeline-persistence: split polling can combine config and registry from different snapshots (flagged 1 times across 1 plans)
[DEBT] timeline-scaling: the plan only specifies a concrete fix for the default scale(1) case; explicit-scale tracks may still break blend-mode effects. (flagged 1 times across 1 plans)
[DEBT] timeline-snap-threshold: threshold is generous (duration) rather than zoom-scaled (8px) (flagged 1 times across 1 plans)
[DEBT] timeline-snap-threshold: computedropposition does not pass a zoom-scaled threshold override (flagged 1 times across 1 plans)
[DEBT] travel-continuations: smooth continuations not threaded — agent tasks won't have continuation_config even when shot settings enable it (flagged 1 times across 1 plans)
[DEBT] travel-continuations: continuation_config omitted from form parity (flagged 1 times across 1 plans)
[DEBT] travel-payload-cleanup-scope: plan scope narrower than original user request (flagged 1 times across 1 plans)
[DEBT] travel-payload-cleanup-scope: broader create-task contract problem left untouched (flagged 1 times across 1 plans)
[DEBT] travel-payload-readers: phase 4 app-side reader audit incomplete (flagged 1 times across 1 plans)
[DEBT] travel-payload-readers: phase 4 field inventory incomplete for app-side readers (flagged 1 times across 1 plans)
[DEBT] travel-request-contract: image_variant_ids is in frontend request contract (flagged 1 times across 1 plans)
[DEBT] travel-request-contract: image_variant_ids contract change (flagged 1 times across 1 plans)
[DEBT] variant-update-b-fresh-takeover: spawn_worker does not internally call start_worker_process; harness must call both explicitly (flagged 1 times across 1 plans)
[DEBT] variant-update-b-fresh-takeover: worker_id and runpod_id must be generated and threaded distinctly; plan currently uses pod_id as both (flagged 1 times across 1 plans)
[DEBT] variant-update-b-fresh-takeover: duplicate of correctness-1 — spawn_worker two-step misstatement (flagged 2 times across 1 plans)
[DEBT] variant-update-b-fresh-takeover: duplicate of correctness-2 — worker_id/runpod_id propagation across takeover and restore paths (flagged 1 times across 1 plans)
[DEBT] variant-update-b-fresh-takeover: duplicate of correctness-1 + correctness-2 — missing create_worker_record glue and start_worker_process integration (flagged 1 times across 1 plans)
[DEBT] variant-update-b-fresh-takeover: duplicate of correctness-2 — caller contract for spawn_worker requires worker_id, not pod_id (flagged 1 times across 1 plans)
[DEBT] verification: no end-to-end render test for audio analysis timing (flagged 1 times across 1 plans)
[DEBT] verification: no automated coverage for text clips or overlapping clips with audio effects (flagged 1 times across 1 plans)
[DEBT] verification-coverage: no automated test exercises the full segment-slot opening path after cleanup. (flagged 1 times across 1 plans)
[DEBT] verification-coverage: no automated coverage that clicking a pair opens the correct modal after cleanup. (flagged 1 times across 1 plans)
[DEBT] verification-coverage: zero behavioral change criterion is not verifiable from tsc + existing tests alone. (flagged 1 times across 1 plans)
[DEBT] verification-workflow: tsconfig.app.json excludes test files, so tsc won't catch test breakage. (flagged 1 times across 1 plans)
[DEBT] worker-test-staleness: worker test in test_additional_coverage_modules.py:37 may assert stale payload structure (task_type vs family). (flagged 1 times across 1 plans)
code
Note: User chose auto-approve mode. This execution was not manually reviewed at the gate. Exercise extra caution on destructive operations.
Robustness level: standard.
Requirements:
- Execute only the actionable tasks in this batch.
- Treat completed tasks as dependency context, not new work.
- Return structured JSON only.
- Only produce `task_updates` for these tasks: [T3, T5]
- Only produce `sense_check_acknowledgments` for these sense checks: [SC4, SC6]
- Do not include updates for tasks or sense checks outside this batch.
- Keep `executor_notes` verification-focused.
- Best-effort progress checkpointing: if `/Users/user_c042661f/Documents/reigh-workspace/vibecomfy/.megaplan/plans/vibecomfy-warm-runtime-20260425-1936/execution_batch_3.json` is writable, checkpoint task and sense-check updates there (not `finalize.json`). The harness owns `finalize.json`.
- When verifying changes, run the entire test file or module, not individual test functions. Individual tests miss regressions.
- finalize.json includes baseline_test_failures — a list of test IDs that were already failing before your changes. If a test fails and its ID appears in baseline_test_failures, it is pre-existing — do not scope-creep into fixing it. If baseline_test_failures is null, the baseline could not be captured; use your judgment but err on the side of assuming failures are regressions. You MUST still re-run the FULL test suite with your changes applied — pre-existing failures do not excuse skipping verification. Never narrow to individual test functions and stop.
- If this batch includes the final verification task, write a short script that reproduces the exact bug described in the task, run it to confirm the fix resolves it, then delete the script.