This compatible patch restores configured custom-provider routing, corrects compression-configuration claims, adds conservative changed-surface CI, and hardens local persistence and telemetry shutdown behavior.
Fixed
- Configured custom providers load and route through their selected upstream.
TokenPak reads the canonical configuration source, routes by normalized
scheme, hostname, and effective port, keeps distinct ports independent,
avoids duplicated
/v1path segments, and preserves fixed endpoint query fields without allowing request overrides. Unsafe userinfo, fragments, and credential query parameters are rejected. A configuredapi_key_envis resolved only for the outbound request and injected using the selected wire format when the client supplied no upstream credential; client credentials are never overwritten or logged. Configured-versus-registered counts remain visible in startup and doctor output. - Compression flags now describe the behavior that ships.
TOKENPAK_COMPACT,compression.enabled, and the compact threshold remain accepted compatibility settings, but the built-in default HTTP proxy does not call the legacy body-compaction helper. CLI and documentation surfaces no longer claim that toggling those settings changes default-HTTP request bytes. - Companion pre-send persistence no longer waits on SQLite writes. Journal and cost updates are queued as one atomic, replayable local intent and drained outside the prompt path. Budget checks reconcile pending intents with the committed database, and interrupted or lock-deferred drains replay without duplicating journal entries or regressing the latest estimate.
- Monitor and telemetry SQLite lifecycle handling is deterministic. Schema setup is transactional and tolerant only of already-applied additive changes; legacy cost rows are preserved while missing columns are added in place; transient writer locks are retried, queued rows retain their target database, shutdown drains are bounded, and failed rows are counted instead of silently reported as persisted.
Changed
- CI now classifies changed surfaces conservatively. An always-running trust baseline, risk-selected jobs, and an always-evaluated result check fail closed for unknown, shared-core, packaging, workflow, large, or multi-surface changes. Every third-party action reference across the repository workflows is pinned to a full peeled commit SHA, and the pin checker now rejects mutable tags and branches. Direct GitHub release downloads must declare and verify a literal SHA-256 before extraction or installation. The release rehearsal also declares the preflight dependency for jobs that consume its tag output. Existing required staging checks remain in force while parity is established.
tokenpak doctor --jsonadds acustom_providersdiagnostic with additiveconfigured,registered, anderrorfields.
Upgrade
python -m pip install --upgrade "tokenpak==1.18.2"
Rollback
python -m pip install --upgrade "tokenpak==1.18.1"
Compatibility
- No breaking change or operator-run data migration is required.
- Python public symbols, TIP wire formats, and public storage schemas are unchanged. Private local Companion, monitor, and telemetry databases receive additive, idempotent plumbing upgrades automatically. The doctor JSON addition is backward-compatible.
Known limitations
- Default-HTTP body compaction remains unwired. Integrations that explicitly call the legacy compact helper can still use its compatibility settings.
- Risk-selected CI is additive in this release; it does not replace the existing required staging contexts until separate parity evidence supports migration.