feat: add amp search and page extraction endpoints#6
Merged
Conversation
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.
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.
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.