Repository navigation
Probe the docs site's own origin for chat only when codewiki serve served it - #19
Merged
Merged
Conversation
dandydarshan
force-pushed
the
fix/chat-local-network-permission
branch
from
November 7, 2026 01:53
4b09125 to
f1e6d68
Compare
dandydarshan
force-pushed
the
fix/no-health-probe-on-pages
branch
from
November 7, 2026 01:53
e30e827 to
09aac00
Compare
dandydarshan
changed the base branch from
fix/chat-local-network-permission
to
main
November 7, 2026 03:14
…rved it The viewer always probed <its origin>/api/health first, which on GitHub Pages is a 404 logged in the browser console on every chat open. `codewiki serve` now marks the HTML it serves with <meta name="codewiki-serve">, and the viewer probes its own origin only when that mark is present. Older servers are still found through the 127.0.0.1 port list; older pages ignore the mark. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CXRqeijND7XPq2srGHndRd
dandydarshan
force-pushed
the
fix/no-health-probe-on-pages
branch
from
November 7, 2026 03:19
09aac00 to
544a2a3
Compare
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.
Summary
The viewer probed
<its own origin>/api/healthbefore the localhost ports, because whencodewiki serveserves the page, the API is on the same origin. On GitHub Pages that probe is always a 404, logged in the browser console every time the chat opens.Marking the page is what makes this safe. A URL rule like "skip https" would break
servebehind an HTTPS proxy or a custom Pages domain. It's compatible both ways: an olderserveis still found through the127.0.0.1port list, and an olderindex.htmlignores the tag.Evidence
test_a_site_not_served_by_codewiki_does_not_probe_its_own_origin: a static site (like Pages) still probes the localhost ports but never its own/api/health. Fails on the old template.test_serve_marks_the_pages_it_serves: one marker, inside<head lang=en>and not<header>, with non-HTML files untouched. Fails on the old server.serveand rely on the same-origin path, all pass.Merge Danger
Door: two-way
Blast Radius: chat discovery
A site served by
serve --host <non-loopback>relies on the marker; that's the case this PR handles. A site behind a proxy that rewrites HTML and drops<meta>tags would fall back to the localhost ports.🤖 Generated with Claude Code
https://claude.ai/code/session_01CXRqeijND7XPq2srGHndRd