Add session replace_prompt passthrough + presenter extra_key_handlers - #3
Closed
wenqingw-nv wants to merge 1 commit into
Closed
Conversation
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>
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! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 callspipeline.replace_texton the internal cache. Guards with a clearRuntimeErrorwhen the underlying pipeline lacksreplace_text(it arrives with the omnidreams live-edit PRs), mirroring the existinginitialize_cache_from_embeddingsguard 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._cachereach and its presenter/keysym edits entirely — we'll rebase it to consume this API.🤖 Generated with Claude Code