Skip to content

Add session replace_prompt passthrough + presenter extra_key_handlers - #3

Closed
wenqingw-nv wants to merge 1 commit into
aidanfnv:dev/aidanf/game/crazy-robotaxi-standalonefrom
wenqingw-nv:robotaxi-463-liveedit-api
Closed

Add session replace_prompt passthrough + presenter extra_key_handlers#3
wenqingw-nv wants to merge 1 commit into
aidanfnv:dev/aidanf/game/crazy-robotaxi-standalonefrom
wenqingw-nv:robotaxi-463-liveedit-api

Conversation

@wenqingw-nv

Copy link
Copy Markdown

The two API additions from our Slack thread, standalone (no live-edit package code):

  • FlashdreamsWorldModelSession.replace_prompt(prompt, *, guidance_scale=1.0, guidance_chunks=0) — flushes the deferred pending-finalize (avoiding the implicit-recache hazard of swapping first), then calls pipeline.replace_text on the internal cache. Guards with a clear RuntimeError when the underlying pipeline lacks replace_text (it arrives with the omnidreams live-edit PRs), mirroring the existing initialize_cache_from_embeddings guard pattern — so this PR stands alone.
  • extra_key_handlers: dict[str, Callable[[], None]] constructor kwarg on both presenters (native HUD + streaming) — generic discrete-keypress registry instead of hardcoded keys, with reserved-key validation so registrations can't silently shadow built-ins. No browser JS change needed.

7 new CPU tests; full crazy_robotaxi ci_cpu suite passes (454 passed, 2 skipped); ruff check + format clean.

With these in, our live-edit integration (NVIDIA#494) drops its session._cache reach and its presenter/keysym edits entirely — we'll rebase it to consume this API.

🤖 Generated with Claude Code

FlashdreamsWorldModelSession.replace_prompt publicly wraps the pipeline's
replace_text on the live cache, flushing the deferred chunk finalize first
so the previous chunk is never re-committed under the new prompt. Both
Crazy Robotaxi presenters gain an extra_key_handlers registry (keysym ->
callback, fired on discrete key press) so composition roots can bind
live-edit keys without patching the key dispatch.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@wenqingw-nv

Copy link
Copy Markdown
Author

Re-targeted upstream now that the branch lives on NVIDIA/flashdreams — superseded by the identical PR against dev/aidanf/game/crazy-robotaxi there. Thanks!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant