Skip to content

Follow-ups to #1: retention cron, inbox cache accessors, release gates, CI - #4

Merged
josephfeleke merged 3 commits into
mainfrom
fix/follow-ups
Sep 2, 2026
Merged

josephfeleke merged 3 commits into
mainfrom
fix/follow-ups

Conversation

@josephfeleke

Copy link
Copy Markdown
Collaborator

Follow-ups from the investigation behind #1 / #2 / #3. Two commits; see each message for the reasoning.

What changes for users

  • Retention actually runs. cleanupFinalizedOutbound was never scheduled; the component now sweeps hourly from its own crons.ts (README: Retention).
  • Inbox cache is readable. New agentmail.listCachedInboxes(ctx) / getCachedInbox(ctx, inboxId) over the component's existing cache queries (README: Inbox cache).

What changes for maintainers

  • npm version and npm publish are both gated on build + test — the publish path previously never ran tsc.
  • CI (build, typecheck, test). The committed lockfile was out of sync and would have failed npm ci; regenerated.
  • lib.codegen.test.ts is back in npm test (it was excluded from every entry point and had rotted); now 13 cases including real coverage of the sweep.
  • npm run typecheck passes for the example app; it also surfaced two bugs in the example (internal.example.draftAutoReply referenced an action that was public; a type-inference cycle).
  • component.d.ts visibility tokens are uniform; smoke.ts --send no longer throws.

Verification

  • typecheck / build / npm ci --dry-run clean; 102 tests pass
  • Mutation checks: removing the sweep's finalizedAt < cutoff guard fails the new test; reverting an action to internal fails both the client test and the build
  • Working tree deployed to a local Convex backend: the cron registers, all seven remote calls resolve into the component, and both cache accessors return results

Deliberately not included

  • A CI check that regenerates _generated and diffs it: convex codegen --component-dir requires a Convex deployment, which CI does not have. npm run build:codegen remains the maintainer path.

🤖 Generated with Claude Code

josephfeleke and others added 3 commits September 1, 2026 19:43
…box cache

cleanupFinalizedOutbound existed but nothing ever scheduled it, so
finalized outbound rows accumulated forever. The component now runs it
hourly from its own crons.ts; at 200 rows per status per run that keeps
up with ~4,800 finalized sends per status per day, and the mutation
stays public so an app can sweep sooner with its own olderThan.

listCachedInboxes and getCachedInbox were public component queries with
no caller. The client now exposes them, so an app can read inboxes it
created from a query, and from React, without an AgentMail round-trip.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ation test

- prepublishOnly and preversion now run build + test, so neither
  `npm publish` nor `npm version` can proceed from a broken tree; before
  this the publish path never ran tsc and shipped whatever dist/ held.
- Add a GitHub Actions workflow (build, typecheck, test). The committed
  package-lock.json was out of sync and would have failed `npm ci` on the
  first run, so it is regenerated here.
- lib.codegen.test.ts was excluded from every vitest entry point and had
  rotted: it never enabled fake timers, and it predates credentials moving
  from mutation args to process.env. Both fixed, the exclude removed, and
  the sweep it claimed to cover is now actually covered.
- Make `npm run typecheck` pass for the example: resolve the package from
  source via tsconfig paths, commit its generated types, annotate the
  client instance to break the internal/exports inference cycle, and make
  draftAutoReply internal, which is how it was already referenced.
- component.d.ts: every app-callable entry now carries the "internal"
  visibility codegen emits, instead of a mix.
- smoke.ts --send passed an undeclared `config` to agentmailFetch.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The lock validated under the local npm but CI's npm 10 rejected it:
the optional @rolldown/binding-wasm32-wasi subtree lacked @emnapi nodes.
Regenerated with npm@10 --package-lock-only; both versions accept it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@josephfeleke
josephfeleke merged commit 46bde1a into main Sep 2, 2026
1 check passed
@josephfeleke
josephfeleke deleted the fix/follow-ups branch September 2, 2026 02:46
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.

1 participant