Skip to content

Release/1.7.6 - #48

Merged
ThHanke merged 19 commits into
mainfrom
release/1.7.6
Sep 24, 2026
Merged

ThHanke merged 19 commits into
mainfrom
release/1.7.6

Conversation

@ThHanke

@ThHanke ThHanke commented Sep 24, 2026

Copy link
Copy Markdown
Owner

New features

WebMCP support (document.modelContext)

  • Full WebMCP spec compliance: document.modelContext polyfill, object-form registerTool, toolchange events, and signal-based unregistration
  • TypeScript types for the polyfill and WebMCP surface
  • Test suite covering polyfill registration, toolchange dispatch, and signal cleanup

AI Relay Bridge — Gemini support

  • Input detection for Gemini's rich-textarea contenteditable component
  • Send-button detection via aria-label="Send message" with visibility guard (Gemini hides the send button with a CSS hidden class during generation instead of using disabled)
  • Streaming detection covers both "Stop generating" and "Stop response" button label variants

AI Relay Bridge — reliability improvements

  • Session locking: relay popup binds to a specific Ontosphere tab; stale-tab messages are dropped
  • Fast session discovery via ping rather than waiting for the next poll cycle
  • 3-minute batch timeout with partial-result flush when individual tool calls hang
  • Incremental injection with pending-count hints for multi-call batches
  • Injection guard blocks new polls while a result is being inserted, preventing dropped results
  • FhGenie stop-button streaming detection (DismissSquare icon path)
  • getGraphState scoped by graph list; unified with canvas summary

SHACL violations

  • Violation messages enriched with rdfs:label values for human-readable property and class names
  • Improved tooltip readability in the SHACL shapes panel

Bug fixes

  • Canvas: Delete key and halo delete button now route through the authoring state machine; nodes no longer reappear after save when deleted via keyboard
  • Relay: reverted polling strategy to isAiStreaming() guard after stability regression; added two-poll idle streak requirement before injection to prevent the UUID-echo bug on OWUI
  • Relay: strict bidirectional session pairing blocks tabs running old bookmarklet code

Breaking changes

None. The WebMCP polyfill is opt-in and backwards-compatible with the existing window.__mcpTools registration path.

Thomas Hanke and others added 19 commits September 23, 2026 15:20
…; fix node reappear after save

Delete key and the halo remove button previously called removeSelectedElements(),
which discarded the canvas element without creating an entityDelete authoring event.
The node was gone visually but still in the RDF store, and reappeared on the next
onSubjectsChange emission.

Replace SelectionActionRemove with DeleteEntityAction, which calls editor.deleteEntity()
for each selected EntityElement. The Delete key hotkey is wired to the same handler
via Reactodia.SelectionAction's built-in hotkey prop, so both the key and the button
now mark nodes as pending-delete in the authoring state and require Save to commit.

The "node reappears after Save" bug had a separate root cause in the worker:
syncRemoveAllQuadsForIri added the deleted IRI to touchedSubjects (it was the subject
of its own quads), and prepareSubjectEmissionFromSet unconditionally emitted it even
though it no longer existed in the store. onSubjectsChange then saw it as a new
subject and re-created the canvas element. Fix: delete the deleted IRI from
touchedSubjects before calling prepareSubjectEmissionFromSet.
…ooltip readability

- Resolve rdfs:labels for sh:path and sh:sourceShape IRIs in both the SHACL
  shapes panel and canvas badge tooltips; fall back to prefix-shortened IRI,
  then local name
- ShaclShapesPanel: fetch labels from urn:vg:ontologies + urn:vg:data on shape
  load; cache result keyed on resolved IRI set so repeated onChange calls skip
  the extra worker round-trips; subscribe to namespace changes for live prefix
  shortening fallback
- ReactodiaCanvas: two-phase validation update — raw messages set immediately
  so badges appear without delay, then a fire-and-forget async pass resolves
  labels and rewrites messages in the provider, store, and currentReasoning
- shaclViolationToEntry: always append path/shape/constraint context even when
  the engine supplies sh:resultMessage; format context on indented sub-lines
  (\n  path / shape) for readable multi-violation tooltips
- ReasoningError/Warning gain optional path field so the full IRI survives
  the worker→main-thread round-trip for label resolution
- ShaclShapesPanel findings span uses whitespace-pre-line so indented context
  renders correctly in the panel list too
…aphState by graph list

relay-bookmarklet.js: isAiStreaming() detects FhGenie Fluent UI dismiss-square
stop button via SVG path selector (M8.22 8.22), preventing early injection
during LLM generation.

relay-mock-chat.html: simulate ChatGPT stop-generating state in lockInput()
via data-stop-generating / aria-busy attributes; add data-composer-submit
to send button for test coverage.

getGraphState: replace always-on shacl block with optional graphs[] param
(default [urn:vg:data, urn:vg:inferred]). SHACL state only returned when
urn:vg:shapes is explicitly requested — prevents AI from querying shapes
graph during default data-graph overviews.

manifest: update getGraphState description and post-reasoning workflow hint
to use graphs:["urn:vg:shapes"] when checking SHACL compliance.
…es path

buildCanvasSummary now calls getGraphState({graphs:[urn:vg:data,urn:vg:inferred]})
instead of getNodes. The canvas model (visual elements) is the authoritative
source — it excludes shapes graph subjects that were leaking into the auto-summary
via allSubjects. Label changed from "Store:" to "Canvas:" to reflect the source.
Each Ontosphere tab now announces itself via vg-hello {sessionId, title} on
startup and every 15 s. relay.html collects announcements and shows a
"Target tab" selector; the user picks which tab handles tool calls.

When a vg-call is forwarded onto the BroadcastChannel it is tagged with
targetSessionId. Each tab ignores calls not addressed to it. vg-result and
vg-ready are tagged with sessionId; relay.html only forwards results from
the selected session to the bookmarklet opener.

vg-ready cross-tab bleed fixed: relayBridge now ignores vg-ready messages
carrying a sessionId that is not its own, preventing a finishing tab from
unblocking the pending-call queue of another tab.
…-call batches

Two fixes for unreliable batching on some chat UIs:

1. idlePoll now checks !isAiStreaming() before extracting tool calls — avoids
   grabbing call 1 while the LLM is still streaming calls 2 and 3, which would
   split a batch and force the LLM to respond before all results arrive.

2. When multiple calls are queued, each result is injected immediately as it
   arrives (rather than accumulating and injecting all at once). Intermediate
   injections include a "⏳ N more tool results pending — do not respond yet"
   hint so LLMs hold off until the final result lands.

batchTotal tracks the original queue size for future use.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Incremental injection caused a race condition: when call 2's result
arrived before call 1's waitForStreamEnd had submitted, injectPartialResult
would overwrite call 1's text in the input field, silently swallowing it.

Reverts to batch-collect-then-inject (all results in one submission).
Keeps the !isAiStreaming() guard in idlePoll — this alone prevents partial
batch extraction by waiting until the LLM has finished streaming its full
message before extracting any tool calls.

Adds pendingCount to injectCombinedResult as a safety net: if a partial
batch does slip through (e.g. after a timeout), the injected text includes
a "N more pending" hint. In normal operation (guard working) this is 0.

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

isAiStreaming() is too UI-specific and unreliable for detecting when the LLM
has finished streaming all tool calls. Replace with a stability window:

- peekToolCalls(): non-destructive lookahead that reads unseen call sigs from
  the page without mutating dispatchedSigs, so it can be called every poll
  tick without prematurely marking calls as dispatched.
- idlePoll() now compares the peekToolCalls() signature across two consecutive
  polls (500 ms apart). Only when the signature is identical (no new calls
  appeared) does it proceed to extractAllToolCalls() and dispatch.
- Any new call appearing mid-stream resets the window, giving the LLM another
  500 ms to render further calls before we commit to the batch size.

Also resets batchTotal = 0 after each batch is injected so stale values from
a previous batch cannot corrupt the "N more pending" hint on the next.

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

relay.html:
- Session row now always visible (was hidden until first vg-hello).
  Shows red dot + "waiting for tabs…" when no Ontosphere tab is known.
  Switches to green dot + dropdown as soon as a tab announces itself.
- vg-call forwarding is blocked when lockedSessionId is null; the relay
  returns a vg-result error immediately so the bookmarklet doesn't hang.
  Status row shows red "blocked — no tab locked" in this state.
- Removed the conditional targetSessionId tagging (now always tagged since
  calls are only forwarded when a session is locked).

relayBridge.ts:
- On vg-ping received, immediately call announceSession() so a freshly-
  opened relay popup discovers this tab in < 1 s instead of waiting up to
  15 s for the next scheduled hello interval.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Root cause: a tab running old relayBridge.ts (built before the sessionId
changes) has no targetSessionId filter, so it handles every vg-call. It also
sends vg-result without a sessionId field, which bypassed relay.html's filter
(the old guard short-circuited on absent data.sessionId).

relay.html:
- Result filter changed from
    if (lockedSessionId && data.sessionId && data.sessionId !== lockedSessionId)
  to
    if (!data.sessionId || data.sessionId !== lockedSessionId)
  Results without sessionId (old code) are now always dropped, not forwarded.

relayBridge.ts:
- Call filter changed from
    if (targetSessionId && targetSessionId !== SESSION_ID)
  to
    if (!targetSessionId || targetSessionId !== SESSION_ID)
  Untagged vg-call broadcasts (old relay or unlocked relay) are now ignored;
  only explicitly addressed calls reach this tab.

Together these two changes enforce bidirectional pairing: the relay must know
which tab to send to (it blocks calls when not locked), and the tab must be
explicitly addressed (it ignores all other calls including untagged ones).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The 500ms stability window (peekToolCalls/stableCallSig) was fighting with
waitForStreamEnd and adding unnecessary latency. Reverted to the simpler
!isAiStreaming() guard in idlePoll — only extract calls when the LLM has
stopped generating, so all calls from one message are visible before any
are dispatched.

Added a 3-minute batch-level timeout (BATCH_TIMEOUT_MS = 180000):
- Starts when idlePoll dispatches the first call of a batch
- Clears on successful batch injection (all results received)
- On fire: flushes whatever batchResults have accumulated so far, formats
  them with a "[Ontosphere — ⏱ batch timeout (N results missing)]" header
  so the LLM knows the batch is incomplete, then resets state for the next
  batch. Handles long-running tools (reasoning, test runs) gracefully.

Also clears the batch timeout in the existing per-call timeout handler
and resets batchTotal there for consistency.

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

When the poll fired while injectInProgress=true (waitForStreamEnd still
pending for the previous batch), it would dispatch the next tool call
immediately. That call's result then arrived while the first injection
was still live — injectResult saw injectInProgress=true and returned
false, silently dropping the result.

Add !injectInProgress guard to idlePoll so new calls are only extracted
and dispatched after the current result has been fully submitted.
Installs webmcp-types 0.1.9 for spec-aligned interfaces. Adds
src/webmcp/types.ts re-exporting ToolDefinition/RegisteredTool/ModelContext
aliases. Augments globals.d.ts with navigator.modelContext compat alias.
Implements installModelContextPolyfill() shim with registerTool/getTools/
executeTool; skips install when native document.modelContext is present.
11 unit tests covering all happy/edge/error paths.
…ect-form registerTool

register.ts: call installModelContextPolyfill() before lazy-loading
ontosphereMcpServer so the shim is in place before any registerTool calls.
ontosphereMcpServer.ts: switch from navigator.modelContext (draft) to
document.modelContext (July 2026 spec); replace positional registerTool args
with object-form { name, description, inputSchema, execute }; update log
message. window.__mcpTools relay path unchanged.
…MCP framing

Starter prompt: names WebMCP, document.modelContext, the polyfill, and the
BroadcastChannel cross-tab limitation explicitly — honest framing for AI chat
users. In-app relay description: adds WebMCP spec link and document.modelContext
mention.
…egistration

registerTool now dispatches a 'toolchange' Event via dispatchEvent after every
registration, and calls ontoolchange if set (IDL event handler parity).
registerTool options.signal: aborts cause the tool to be removed from the
registry and a second toolchange event to fire, matching the spec's
unregistration mechanism. 3 new tests covering addEventListener, ontoolchange
handler, and signal-driven unregistration (14 total, all pass).
- findInput: priority path for rich-textarea [contenteditable] (Gemini)
- findSendButton: explicit check for Gemini's send button aria-label,
  excluding buttons with CSS hidden class (Gemini hides send during
  generation instead of using disabled)
- isAiStreaming: Gemini stop button covers both "Stop generating" and
  "Stop response" label variants; send-button visibility check via
  getBoundingClientRect prevents false-idle during generation
- isAiStreaming: Claude.ai stop-button detection scoped to
  data-theme="claude" pages
The session-locking guard (added in this release) blocks vg-call
forwarding until a tab is locked. The test now adds a synthetic option
to the session dropdown and dispatches 'change' to write the closure
variable before firing messages.
@ThHanke
ThHanke merged commit 2563519 into main Sep 24, 2026
4 checks passed
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