Title: Phase 2: Expand docs/handler-authoring.md with salesagent-migration lessons (PR-T) · Issue #229 · adcontextprotocol/adcp-client-python · GitHub
Open Graph Title: Phase 2: Expand docs/handler-authoring.md with salesagent-migration lessons (PR-T) · Issue #229 · adcontextprotocol/adcp-client-python
X Title: Phase 2: Expand docs/handler-authoring.md with salesagent-migration lessons (PR-T) · Issue #229 · adcontextprotocol/adcp-client-python
Description: Summary docs/handler-authoring.md covers the first 80% of the authoring journey. Once salesagent completes their MCP migration using the SDK's new hooks, a bunch of concrete patterns surface that this guide should document for the next a...
Open Graph Description: Summary docs/handler-authoring.md covers the first 80% of the authoring journey. Once salesagent completes their MCP migration using the SDK's new hooks, a bunch of concrete patterns surface that t...
X Description: Summary docs/handler-authoring.md covers the first 80% of the authoring journey. Once salesagent completes their MCP migration using the SDK's new hooks, a bunch of concrete patterns surface th...
Opengraph URL: https://github.com/adcontextprotocol/adcp-client-python/issues/229
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Phase 2: Expand docs/handler-authoring.md with salesagent-migration lessons (PR-T)","articleBody":"## Summary\n\n`docs/handler-authoring.md` covers the first 80% of the authoring journey. Once salesagent completes their MCP migration using the SDK's new hooks, a bunch of concrete patterns surface that this guide should document for the next adopter.\n\n## Intended additions\n\nPost-migration feedback should drive the specifics, but a rough list:\n\n- **ResolvedIdentity pattern**, end-to-end. The guide mentions it; expand into a real example showing the `_impl` layer taking a typed identity, the `ADCPHandler` delegating, and the `context_factory` populating from token → DB lookup.\n- **Tenant routing from token.** Nginx-only subdomain → tenant + bearer-token → principal, both resolved inside `BearerAuthMiddleware`. salesagent's actual prod pattern. Include the Postgres lookup sketch.\n- **Discovery-skill exemption in practice.** `DISCOVERY_TOOLS | {\"list_public_formats\", ...}` + `validate_discovery_set()` + the composed `method in DISCOVERY_METHODS or (method == \"tools/call\" and name in DISCOVERY_TOOLS)` gate from #222.\n- **Keeping `SalesAgentHandler(ADCPHandler)` class thin.** Every method is a one-line delegation to `_impl.*`; the class exists to translate between SDK `ToolContext` and internal `ResolvedIdentity`. Structural test that enforces this (a grep-based check that handler methods don't do business logic).\n- **Idempotency wiring.** `@store.wrap` on create/update methods; `ToolContext.caller_identity` + `tenant_id` populated by the factory; the warning on missing-principal calls.\n- **Error classification in practice.** When to raise `adcp_error(\"BUDGET_TOO_LOW\")` vs a plain `ADCPTaskError`; the AdCP error-code taxonomy.\n- **Troubleshooting section.** \"My handler runs but idempotency dedup isn't firing\" → check `caller_identity`. \"My context_factory returned a dict and now the handler explodes\" → the `isinstance` guard error message.\n\n## Acceptance\n\n- Appended to `docs/handler-authoring.md` (or split into `docs/handler-authoring-advanced.md` if it gets big).\n- Cross-links from `examples/mcp_with_auth_middleware.py` and `MIGRATION_v3_to_v4.md`.\n- Skim-pass from salesagent (or another adopter) confirming the recipes reflect actual production setups, not just theory.\n\n## Context\n\nRoadmap item PR-T (Phase 2). Explicitly scheduled for after at least one downstream has completed MCP adoption — don't guess at the lessons; ship what the migration actually surfaced.","author":{"url":"https://github.com/bokelley","@type":"Person","name":"bokelley"},"datePublished":"2026-04-20T06:07:55Z","url":"https://github.com/adcontextprotocol/adcp-client-python/issues/229"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:cd7e4467-172d-bc0c-26ff-78e37cb9f523 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B796:CC1A4:D4A93E:10F824A:6B01027E |
| html-safe-nonce | 79651eeb19cf14c8c3212f90d8415a0c5aa5152ded5ec177732739b0d3c4b0f0 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNzk2OkNDMUE0OkQ0QTkzRToxMEY4MjRBOjZCMDEwMjdFIiwidmlzaXRvcl9pZCI6IjIxMzM5NTgxOTIxODk3MzU1NTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9f229e038af777c7966dc53b063e7be95280f5d1890f64ff06438fc027c4f9e8 |
| hovercard-subject-tag | issue:4293476227 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/adcontextprotocol/adcp-client-python/229/issue_layout |
| twitter:image | https://opengraph.githubassets.com/bba11d66023342d115a92f1ed8805ac96617e557d0fa77be6ecb1ee2ff912310/adcontextprotocol/adcp-client-python/issues/229 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/bba11d66023342d115a92f1ed8805ac96617e557d0fa77be6ecb1ee2ff912310/adcontextprotocol/adcp-client-python/issues/229 |
| og:image:alt | Summary docs/handler-authoring.md covers the first 80% of the authoring journey. Once salesagent completes their MCP migration using the SDK's new hooks, a bunch of concrete patterns surface that t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bokelley |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| turbo-cache-control | no-preview |
| go-import | github.com/adcontextprotocol/adcp-client-python git https://github.com/adcontextprotocol/adcp-client-python.git |
| octolytics-dimension-user_id | 221690821 |
| octolytics-dimension-user_login | adcontextprotocol |
| octolytics-dimension-repository_id | 1090305973 |
| octolytics-dimension-repository_nwo | adcontextprotocol/adcp-client-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1090305973 |
| octolytics-dimension-repository_network_root_nwo | adcontextprotocol/adcp-client-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width