Plan updated with the alknet-tty findings: the drainer pattern (single ordered writer) makes outbound chunk-boundary parsing sound; TestStdinSink's try_send→Full→Pending is the inbound backpressure precedent; OQ-01(a) now cites the reference. Task graph (taskgraph-validated, 17 tasks, 6 generations, no cycles): - tasks/server/: core-types, auth, healthz-decoy, adapter - tasks/gateway/: dispatch, routes, publish - tasks/websocket/: byte-adapter (research POC), upgrade-session, overlay-ops - tasks/adapters/: from-openapi, from-jsonschema, to-openapi, from-wss, mcp - tasks/client/: http-host - tasks/infra/: integration-suite (phase 4) Critical path runs through server core → adapter → WS session → overlay tests → integration suite. High-risk tasks are the three WS tasks, de-risked by the ws-byte-adapter POC blocking upgrade-session.
42 lines
1.2 KiB
Markdown
42 lines
1.2 KiB
Markdown
---
|
|
id: client-http-host
|
|
name: Shared reqwest client host (middleware stack, retry-after)
|
|
status: pending
|
|
depends_on: []
|
|
scope: narrow
|
|
risk: low
|
|
impact: component
|
|
level: implementation
|
|
tags: [client, phase-3]
|
|
---
|
|
|
|
## Description
|
|
|
|
Port the outbound HTTP client host from
|
|
`/workspace/@alkdev/alknet/crates/alknet-http/src/client/`:
|
|
`ClientWithMiddleware` shared across forwarding handlers;
|
|
`RetryTransientMiddleware` (exponential backoff) + inlined
|
|
`RetryAfterMiddleware` (parse Retry-After on 429/503, bounded URL→time
|
|
map); ArcSwap rebuild-and-swap for config hot-reload. Credential
|
|
injection is per-request from OperationContext.capabilities — never at
|
|
client construction, never from env vars.
|
|
|
|
## Acceptance Criteria
|
|
|
|
- [ ] Client host ported with the middleware stack; inlined Retry-After (bounded storage)
|
|
- [ ] ArcSwap hot-swap tested (config change → new pool)
|
|
- [ ] No env-var reads (invariant test)
|
|
- [ ] `cargo test` passes
|
|
|
|
## References
|
|
|
|
- docs/architecture/http-adapters.md (§HTTP client (reqwest))
|
|
- Old source: `/workspace/@alkdev/alknet/crates/alknet-http/src/client/{http_client,retry_after}.rs`
|
|
|
|
## Notes
|
|
|
|
> Agent fills during implementation.
|
|
|
|
## Summary
|
|
|
|
> Agent fills on completion. |