Skip to content

feat: add amp search and page extraction endpoints#6

Merged
whtsky merged 7 commits into
mainfrom
feat/amp-search
Jun 25, 2026
Merged

feat: add amp search and page extraction endpoints#6
whtsky merged 7 commits into
mainfrom
feat/amp-search

Conversation

@whtsky

@whtsky whtsky commented Apr 26, 2026

Copy link
Copy Markdown
Owner

Handle webSearch2 locally via Copilot Responses API with web_search tool (gpt-5-mini), and extractWebPageContent via Jina Reader, so amp CLI web search works without a paid ampcode.com account.

whtsky and others added 7 commits April 26, 2026 16:48
Handle webSearch2 locally via Copilot Responses API with web_search
tool (gpt-5-mini), and extractWebPageContent via Jina Reader, so amp
CLI web search works without a paid ampcode.com account.

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
When the upstream model list contains a better variant (e.g.
claude-opus-4.7-1m-internal), automatically use it instead of the base
model. This enables features like effort: high that are only supported
by extended variants.

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
The auto-upgrade logic already promotes models to -1m/-1m-internal
variants, making the explicit anthropic-beta header detection redundant.

Add COPILOT2API_NO_MODEL_UPGRADE env var to opt out of auto-upgrade.
Update README to document auto-upgrade behavior.

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
… model

The normalizeNativeMessagesBody was receiving the alias-resolved model
(e.g. claude-opus-4.7) instead of the auto-upgraded model
(e.g. claude-opus-4.7-1m-internal), causing upstream to reject requests
with unsupported effort/thinking values for the non-upgraded model.

Also adds debug logging for upstream request/response bodies.
Amp local mode is always enabled. Thread management (upload, get, list,
search, delete, meta merge), telemetry, user info, and other management
APIs are served from local ~/.local/share/amp/threads/ instead of
proxying to ampcode.com. Unhandled /api/ routes still fall through to
the ampcode.com reverse proxy.

Endpoints:
- GET  /api/threads/find — full-text search across local threads
- GET  /api/threads/{id}.md — render thread as markdown
- POST /api/internal — uploadThread, setThreadMeta, deleteThread,
  getThread, listThreads, getUserInfo, and 15+ other method stubs
- POST /api/telemetry — no-op
- POST /api/durable-thread-workers/{id} — stub
- GET  /api/users/{id}, /api/attachments, /news.rss — stubs

Supports gzip-compressed request bodies and params-wrapped payloads.
@whtsky
whtsky merged commit 6f32582 into main Jun 25, 2026
3 checks passed
@whtsky
whtsky deleted the feat/amp-search branch June 25, 2026 07:46
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