Repository navigation
Bump basecamp-sdk to v0.29.1 for in-band stream renewal, and log renewals - #967
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
The documented merge prerequisite remains replacing the temporary SDK pin with the Go release tag and updating and validating the associated hashes.
No open issues 🎉
What changed in this PR
Updates the Basecamp SDK to a temporary revision supporting in-band event-stream renewal and adds connector logging for renewal lifecycle events.
Changes:
- Updates the SDK pin, provenance records, module checksums, and Nix vendor hash.
- Logs advertised deadlines, successful renewals, and renewal failures with retry or reconnect outcomes.
- Adds tests for renewal logging, failure messages, and keeping renewal tickets out of logs.
[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or rungh pr ready --undo.
Click "Ready for review" or rungh pr readyto reengage.
| File | Description |
|---|---|
nix/package.nix |
Updates the vendor hash for the SDK bump. |
internal/version/sdk-provenance.json |
Records the temporary SDK version and revision. |
internal/mcpserver/model/PROVENANCE.json |
Updates the model source revision and tag. |
internal/connector/renewal_log_test.go |
Tests renewal logs and ticket secrecy. |
internal/connector/intake.go |
Adds renewal lifecycle logging callbacks. |
go.sum |
Updates SDK module checksums. |
go.mod |
Pins the SDK revision containing in-band renewal. |
Review effort: Balanced
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
v0.29.1 carries basecamp/basecamp-sdk#1044, which renews the event stream over the open socket before the deadline a welcome advertises. v0.29.0 never published a Go module, so this skips it. The vendored MCP model is unchanged since v0.28.1; only its provenance moves.
A server that bounds the ticket stream by its token's expiry advertises the deadline in the welcome, and the SDK renews the socket in band before it. The connector logs every other socket lifecycle callback and none of these three, so a renewal that gave up left only an unexplained remote close. Log the advertised deadline, each renewal, and each failure, saying whether it is retried or left to the server's lease.
basecamp-sdk v0.29.1 adds in-band renewal of the event stream (basecamp/basecamp-sdk#1044). When bc3 puts a stream deadline in the welcome, the connector renews the socket over the open connection about three minutes before that deadline. A held agent stream then stays up instead of dropping and reconnecting once an hour.
The pin
This pins
github.com/basecamp/basecamp-sdk/go v0.29.1(0b66bbc3). v0.29.0 never published a Go module: its Release Go SDK run failed on a flaky ETag-cache race test, sogo/v0.29.0was never tagged. basecamp/basecamp-sdk#1051 fixed the test's setup, and v0.29.1 shipped it. Between v0.29.0 and v0.29.1 the only Go changes are that test (go/pkg/basecamp/etag_doer_test.go) and the version stamp, so the SDK code this PR builds against is the code #1044 shipped.The branch was rebuilt on the release pin. It replaces the earlier commit that pinned 5908bb54's pseudo-version, so no commit here pins anything but v0.29.1.
scripts/bump-sdk.sh v0.29.1updated go.mod, go.sum andinternal/version/sdk-provenance.json.scripts/sync-mcp-model.shat v0.29.1 leftbehavior-model.jsonandopenapi.jsonbyte-for-byte unchanged from v0.28.1. Onlyinternal/mcpserver/model/PROVENANCE.jsonmoves.make update-nix-hashupdated the vendorHash innix/package.nixand built the flake with it.The connector
intake logs every socket lifecycle callback the SDK has, except the three #1044 adds. Without them, a renewal that gave up would show up only as an unexplained
remotedisconnect at the deadline. intake now logs these too:StreamDeadline(info): the deadline the welcome advertised.Renewed(info): the new deadline.RenewFailed(warn): the kind of failure, from the SDK's closed list (refused,no_reply,mint_failed,invalid_reply), and whether it will be retried. If it won't, the line says the server's lease will close the socket and the connector will reconnect as it does after any disconnect.Nothing changes in
connect statusorconnect doctor:ConnectionStatussays: "It is not the feed socket's state, which intake does not report." Renewal belongs to one socket and is short-lived. It never ends the feed and decides nothing: a renewal that gives up falls back to the reconnect and catch-up the connector already does. Showing it in status would take a ledger write for every renewal, plus a migration, for something no person has to act on.The token path needs no change. A renewal mints its ticket the same way the connect does, through
feedTokensandauth.Manager.AccessToken, which refreshes the token once it is withinauth.RefreshWindow(5 minutes) of expiry. A renewal is due 3 minutes ± 30 s before the deadline, so its mint gets the later token the server requires.Verification
make checkpassed on Linux (thelio) at 177b625, the head.make update-nix-hashupdated the vendorHash and built the flake with it.TestAnInBandRenewalReachesTheConnectorLogruns a real renewal through intake's feed: a welcome with a deadline, then subscribe, catch-up, therenewcommand and therenewedreply. It checks that both log lines carry their deadlines and that the renewal's ticket stays out of the log.TestAFailedRenewalSaysWhetherItIsRetriedOrLeftToTheLeasechecks the retry line and the give-up line.-race, at the head.