Skip to content

feat(chat): read and summarize linked documents via readm3 - #121

Merged
sh1pt-actions-fleet[bot] merged 1 commit into
masterfrom
feat/chat-read-url
Nov 2, 2026
Merged

sh1pt-actions-fleet[bot] merged 1 commit into
masterfrom
feat/chat-read-url

Conversation

@sh1pt-actions-fleet

Copy link
Copy Markdown
Contributor

Makes "can you summarize this for me in both technical and layman terms? https://arxiv.org/pdf/2106.01820\" work in /chat.

  • lib/doc-urls.js: finds up to 2 http(s) links in the message (trailing punctuation stripped).
  • lib/read-url.js: reads through readm3's new reader (POST https://readm3.com/api/v1/read, feat: document reader: /api/v1/read, hosted MCP read_url, readm3 read (0.32.0) profullstack/readm3#86: PDF/HTML/office/text, public addresses only, free hourly allowance then x402). Fits the text into CHAT_DOC_CHARS (default 7,000 ≈ 1.8k tokens, so it fits a 4k-context node next to the answer): 75% from the start (title, abstract, intro), 25% from the end (conclusion), with a marker. Builds a system message telling the model to answer from the document and not invent.
  • POST /api/chat/read {url}: 20/hour per IP, CHAT_READ_DAILY_CAP (1000). readm3's 402 becomes a plain "allowance used up" note.
  • chat-view.js: when the message has a link, shows "Reading arxiv.org…", prepends the context for this turn (same path as web search, so E2E chats send only the URL), and lists "Read <title> · PDF, 17 pages" under the answer. Failures show a note and the model answers without it.
  • Optional READM3_TOKEN (already read by the Readm3 export route) makes the reads unmetered.

Tests: tests/chat-read-url.test.js (8). Web-search tests still pass.

🤖 Generated with Claude Code

… answering

A link in a chat message ("summarize this https://arxiv.org/pdf/2106.01820")
is read through readm3's reader via /api/chat/read, fitted to the small
models' context (start + end, CHAT_DOC_CHARS, default 7000) and prepended
as this turn's system message, like web search. Only the URL reaches the
server, so E2E chats keep working. READM3_TOKEN (optional) skips readm3's
free hourly allowance.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

ThreatCrush Security Scan

40 finding(s)

HIGH/CRITICAL: 6 | MEDIUM: 14 | LOW: 20

Severity Rule Location
HIGH js-electron-node-integration apps/desktop/electron/main.js:27
HIGH secret-generic-api-key apps/web/app/getting-started/page.js:136
HIGH secret-generic-api-key docs/book/01-introduction/getting-started.md:40
HIGH secret-database-url docs/MIGRATIONS.md:56
HIGH secret-database-url ipips/ipip-0013.md:187
HIGH sensitive-file-committed sample.env:1
MEDIUM secret-hex-token apps/mobile/src/context/AuthContext.js:170
MEDIUM secret-hex-token apps/mobile/src/context/AuthContext.js:239
MEDIUM secret-hex-token apps/web/app/docs/page.js:293
MEDIUM js-unescaped-html-sink apps/web/app/layout.js:148
MEDIUM js-open-redirect apps/web/app/order/order-view.js:43
MEDIUM js-unescaped-html-sink apps/web/components/pit-footer.js:30
MEDIUM js-indirect-code-sink apps/web/lib/operator-vault.js:33
MEDIUM js-indirect-code-sink apps/web/lib/operator-vault.js:34
MEDIUM js-indirect-code-sink apps/web/lib/operator-vault.js:38
MEDIUM sh-remote-script-execution install.sh:581
MEDIUM sh-remote-script-execution install.sh:719
MEDIUM sh-remote-script-execution install.sh:969
MEDIUM sh-predictable-temp-path install.sh:1255
MEDIUM redos-nested-quantifier packages/gpu/src/interconnect.js:177
LOW secret-generic-credential docs/book/04-building-apps/index.md:33
LOW secret-generic-credential tests/auth-parse-body.test.js:43
LOW secret-generic-credential tests/auth-parse-body.test.js:46
LOW secret-generic-credential tests/auth-parse-body.test.js:64
LOW secret-generic-credential tests/auth-parse-body.test.js:70
LOW secret-generic-credential tests/auth-parse-body.test.js:73
LOW secret-hex-token tests/cli-peers.test.js:51
LOW secret-jwt tests/cpr-canary.test.js:26
LOW secret-hex-token tests/cpr-receipts.test.js:179
LOW secret-hex-token tests/cpr-receipts.test.js:182
LOW secret-generic-api-key tests/deploy-providers-foundation.test.js:220
LOW secret-private-key tests/liquid-agent.test.js:88
LOW secret-hex-token tests/node-commands-auth.test.js:68
LOW secret-hex-token tests/node-commands-auth.test.js:69
LOW secret-generic-api-key tests/operator-vault.test.js:62
LOW secret-generic-credential tests/profile-signup.test.js:53
LOW secret-generic-credential tests/profile-signup.test.js:65
LOW secret-generic-credential tests/profile-signup.test.js:90
LOW secret-generic-credential tests/reservation-orders.test.js:152
LOW secret-generic-credential tests/reservations.test.js:263

Snippets are redacted; ThreatCrush never prints matched credential material.

@sh1pt-actions-fleet
sh1pt-actions-fleet Bot merged commit a05e254 into master Nov 2, 2026
7 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