Skip to content

DX-3099: add Amp custom harness example - #253

Merged
CahidArda merged 2 commits into
mainfrom
DX-3099
Oct 6, 2026
Merged

CahidArda merged 2 commits into
mainfrom
DX-3099

Conversation

@alitariksahin

Copy link
Copy Markdown
Collaborator

Adds packages/sdk/examples/custom-amp-agent.ts, a custom harness that runs Amp inside a box.

  • Runs amp -x --stream-json and maps Amp's stream JSON (Claude Code format) to box-sse-v1 events: text, tool calls, tool results, token usage
  • Box sessions map to Amp threads (amp threads continue); threads are created with --no-archive-after-execute so they can be continued
  • model is an Amp mode (low, medium, high, ultra) and is applied on follow-ups too
  • MCP servers (npm and URL) are passed through --mcp-config
  • Prompt files: text is inlined, other files are saved to /workspace/home/.box-attachments/<uuid>/<name>
  • JSON_SCHEMA and AGENT_OPTIONS log a warning (no Amp equivalent)
  • Needs AMP_API_KEY; cost is reported as 0 since Amp doesn't expose $ usage

Testing

Run live against Box and Amp:

  • streaming with tool events, follow-up on the same thread, token counts
  • MCP: @modelcontextprotocol/server-everything (npm) and context7 (URL)
  • text + image attachments, two attachments with the same filename, reused filename across turns
  • thread survives pause/resume
  • low mode, switching mode with configureModel("high") before a follow-up
  • invalid AMP_API_KEY fails the run with Amp's error message

Docs: upstash/docs PR to follow (adds the Amp page under Custom Harness).

🤖 Generated with Claude Code

Runs the Amp CLI in execute mode and maps its stream JSON to box-sse-v1.
Box sessions map to Amp threads; supports MCP servers, prompt files, and
mode changes on follow-ups.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Oct 1, 2026

Copy link
Copy Markdown

DX-3099

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CahidArda
CahidArda merged commit 13ea0b8 into main Oct 6, 2026
2 of 3 checks passed
@CahidArda
CahidArda deleted the DX-3099 branch October 6, 2026 07:41
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.

2 participants