GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(server): EPUB chapters with a query in their href extract their text by only21mil · Pull Request #41553 · pingdotgg/t3code

Conversation

@only21mil

@only21mil only21mil commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Problem

When an EPUB attachment's manifest gives a chapter href with a query, for example <item href="a.xhtml?x=1"/> for the entry a.xhtml, the agent gets no text for that chapter, only [Skipped document part: a.xhtml?x=1 (missing or invalid XML).]. A manifest href is a URL, and its query is not part of the file name. The server's text extractor already removed the #fragment but kept the ?query.

Change

documentTextWorker.ts now removes both before decoding: href.split(/[?#]/, 1)[0], the same way the web EPUB preview (archivePath in extendedDocumentPreview.ts) already reads these hrefs. A ? or # that is part of a file name is percent-encoded in the href (%3F, %23), so it still decodes to the literal character. One case is added to the existing EPUB table in userInputAttachments.test.ts.

Scope

This is a small bug fix with no issue, and it only changes the server. One case changes on purpose: an entry with a literal ? before its extension, such as a?x=1.xhtml, is no longer found through the unencoded href a?x=1.xhtml. A valid href writes it as a%3Fx=1.xhtml, which still works, and the web preview already behaves this way.

Verification

An AI agent ran each check on Linux with no accounts.

Setup: Linux x86_64, Node 26.13.1, a synthetic EPUB whose package lists <item href="a.xhtml?x=1"/>, with the entry OEBPS/a.xhtml.
Steps: node apps/server/src/bin.ts __document-text query-href.epub .epub (the same worker entrypoint the server starts for attachments)

f58085a1c2e5 (main) 8417089e8a52 (this PR)
## Chapter 1
[Skipped document part: OEBPS/a.xhtml?x=1 (missing or invalid XML).]
## Chapter 1
The lighthouse keeper counted ships at dawn.
  • vp test run apps/server/src/provider/userInputAttachments.test.ts: the new case (q%3F1.xhtml?x=1 and chapter%201.xhtml?v=2#sec1) fails on main (both chapters become skip notes) and passes with this change (53/53).
  • vp run check:changed: passes.

Generated with Gemini 4 Neon in T3 Code Nightly

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@only21mil
fix(server): EPUB chapters with a query in their href extract their text
8417089
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 23, 2026
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The EPUB worker now removes a query string or fragment from a chapter href before percent-decoding it. A test covers an href with an encoded question mark and query and fragment suffixes.

Changes: EPUB chapter href handling

Layer / File(s) Summary
Strip suffixes before decoding
apps/server/src/provider/documentTextWorker.ts, apps/server/src/provider/userInputAttachments.test.ts
The worker removes a query string or fragment before decoding an EPUB chapter href. The test checks that the matching chapter text is extracted without skipped-part or truncation markers.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Suggested reviewers: lucenx9, marve10s

Merge Risk: Minimal · up to 4279c

EPUB chapters whose manifest hrefs carry query strings or fragments are now extracted instead of skipped. The fix is small and has a test covering an encoded question mark with suffixes. No merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the fix (EPUB chapters whose href contains a query now extract their text) and the server scope. It matches the main change in documentTextWorker.ts, which now strips the query string …
Description check Passed The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives the expected behavior and the observed skip note for an href such as a.xhtml?x…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the fix (EPUB chapters whose href contains a query now extract their text) and the server scope. It matches the main change in documentTextWorker.ts, which now strips the query string or fragment from chapter hrefs before decoding, and the added test case. It follows the conventional commit form in the template.

Full details: Description check

Explanation

The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives the expected behavior and the observed skip note for an href such as a.xhtml?x=1. The Change section explains the split-and-decode approach and the percent-encoding case. The Scope section says it is a small bug fix with no issue, and it states the intentional behavior change for unencoded literal '?' names. The Verification section gives the commands, the environment, a before/after comparison, and the test results. It does not link an issue, but the author explains why none is needed, which the template allows. The agent-model line is present. The description is complete and specific.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: pingdotgg/t3code
  • Branch: main
  • File: .coderabbit.config.ts
  • Commit: 7182abe
  • Layers: Repository TS config
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1cd2fd59-b666-4c52-be27-70919a681f17
Commits

Reviewing files that changed from the base of the PR and between 8417089 and 4279cae.

Files selected for processing: 1

  • apps/server/src/provider/userInputAttachments.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 23, 2026
juliusmarminge and others added 2 commits November 23, 2026 17:22
@juliusmarminge
Merge remote-tracking branch 'origin/main' into fix/server-epub-chapt…
0c4d84f
…er-query
@juliusmarminge @claude
test(server): cover EPUB chapter query with one fixture
4279cae
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@juliusmarminge

juliusmarminge commented Nov 23, 2026

Copy link
Copy Markdown
Member

Evidence

Attach the same synthetic EPUB on fresh databases and ask a deterministic ACP reader to quote the server-generated extracted text. Exercise query, plain, fragment, and percent-encoded question-mark hrefs. Linux Chromium, 1280×800, light theme. Recordings begin after pairing.

Scenario: EPUB query href chapters reach the agent without losing literal encoded question marks

Proven: the scenario fails on base 7182abeeaa and passes on head 4279caec81.

Before: Base 7182abeeaa After: Head 4279caec81
Result ❌ Walrus sentence absent; Chapters 1 and 4 skipped ✅ All four chapters present
epub extracted chapters Before: empty query chapters and skip notes After: query and encoded filename chapters extracted
failure Base assertion failure
Recording Before attachment flow After attachment flow

Scenario source, including synthetic EPUB fixture and deterministic reader.

Not shown:

  • Codex GPT-6-Luna's natural-language response was not repeated; a deterministic ACP reader quoted the actual server-generated extracted sidecar to isolate the provider-independent extraction defect.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 23, 2026
@juliusmarminge
juliusmarminge merged commit 6aad800 into pingdotgg:main Nov 23, 2026
54 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 23, 2026
@patroza patroza mentioned this pull request Nov 24, 2026
Merge upstream main through 2fe7febc8d73 patroza/t3code#671
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@only21mil @juliusmarminge
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.