Skip to content

fix(lr-a3ca): replace double getPendingNavigate() with peekPendingNavigate() in history_meta#217

Merged
akuehner merged 4 commits into
mainfrom
fix/lr-a3ca-pending-navigate
Jun 11, 2026
Merged

fix(lr-a3ca): replace double getPendingNavigate() with peekPendingNavigate() in history_meta#217
akuehner merged 4 commits into
mainfrom
fix/lr-a3ca-pending-navigate

Conversation

@akuehner

Copy link
Copy Markdown
Member

No description provided.

akuehner and others added 4 commits June 10, 2026 21:06
…igate() in history_meta

getPendingNavigate() clears pendingNavigate on every call.  The history_meta
branch called it twice: the first call returned the nav object and nulled it;
the second returned null and threw TypeError on .toolId access.  The nav was
also consumed before history_done could use it, so the "Go to chat" scroll
never fired.

Add peekPendingNavigate() to filebrowser.js that reads pendingNavigate without
clearing it.  Replace the triple getPendingNavigate() calls in the history_meta
condition with a single peekPendingNavigate() into a local.  The consuming
getPendingNavigate() in history_done is unchanged and remains the sole consumer.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ontract

Verifies that peekPendingNavigate() is non-consuming (called twice returns
the same object) and that getPendingNavigate() consumes exactly once. The
regression test explicitly exercises the pre-fix buggy path (three
getPendingNavigate() calls in history_meta) and asserts it leaves history_done
with null — proving the peek-only fix is load-bearing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…dd regression tests

filebrowser.js imported three functions from a new DOM-free module
(lib/public/modules/pending-navigate.js) instead of holding inline
implementations.  This makes the peek/consume contract testable in Node
without a DOM shim.

test/pending-navigate.test.js imports the real module and covers:
- peekPendingNavigate is non-consuming (two peeks return the same object)
- getPendingNavigate is consuming (second call returns null)
- Nav survives history_meta (peek path) and is consumed by history_done
- Regression: consuming get in history_meta clears nav before history_done

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…orts real ESM module)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@akuehner akuehner merged commit 72f0bdf into main Jun 11, 2026
1 check passed
@akuehner akuehner deleted the fix/lr-a3ca-pending-navigate branch June 11, 2026 01:25
@clagentic-release-bot

Copy link
Copy Markdown

This issue has been resolved in version 1.5.0-beta.1 (beta).

To update, run:

npx @clagentic/console@1.5.0-beta.1

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant