Fix component by passing AGENTMAIL_API_KEY using standard Convex recomendations - #6
Open
nicu-chiciuc wants to merge 7 commits into
Open
nicu-chiciuc wants to merge 7 commits into
nicu-chiciuc wants to merge 7 commits into
Conversation
Elioz404
pushed a commit
to Elioz404/Backpack
that referenced
this pull request
Sep 14, 2026
The three-inbox free tier was the last hard wall: a household got an inbox of its own, so the fourth family could not have an address. It turns out not to be a wall — AgentMail delivers sub-addressed mail, which is not in their docs either way, so it was worth probing rather than assuming. Households now share one inbox and are told apart by tag: each gets <inbox>+<householdId>@, and inbound mail routes on the address it was sent to. That one indexed lookup covers both shapes, since a household from before this stores the bare inbox address and matches the same way — nothing already live changed. A guarded second path accepts a tag naming a real household whose address we have not stored, but only when that household claimed this inbox, so a guessed id cannot put mail on someone else's board. Dropped the now-unused by_inbox index rather than leave it costing writes. Proven in production with two households on one inbox: a notice to the second household's sub-address produced one correctly typed obligation on its board and left the first household's seven untouched. Also recorded that the component defect was independently found four days earlier in agentmail-to/convex#6, still open and unmerged.
Elioz404
added a commit
to Elioz404/Backpack
that referenced
this pull request
Sep 15, 2026
The three-inbox free tier was the last hard wall: a household got an inbox of its own, so the fourth family could not have an address. It turns out not to be a wall — AgentMail delivers sub-addressed mail, which is not in their docs either way, so it was worth probing rather than assuming. Households now share one inbox and are told apart by tag: each gets <inbox>+<householdId>@, and inbound mail routes on the address it was sent to. That one indexed lookup covers both shapes, since a household from before this stores the bare inbox address and matches the same way — nothing already live changed. A guarded second path accepts a tag naming a real household whose address we have not stored, but only when that household claimed this inbox, so a guessed id cannot put mail on someone else's board. Dropped the now-unused by_inbox index rather than leave it costing writes. Proven in production with two households on one inbox: a notice to the second household's sub-address produced one correctly typed obligation on its board and left the first household's seven untouched. Also recorded that the component defect was independently found four days earlier in agentmail-to/convex#6, still open and unmerged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes credential access inside the AgentMail component.
Component functions [do not inherit the app’s environment variables](https://docs.convex.dev/components/authoring#environment-variables), so
AGENTMAIL_API_KEYandAGENTMAIL_BASE_URLmust be declared and explicitly bound.The component now reads these through the generated typed
envexport, and the README/example show the required bindings.The app-side client (in AgentMail) retains
process.env, which is supported for [client wrappers running in the app’s environment](https://docs.convex.dev/components/authoring#wrapping-the-component-with-client-code).Although its current role might be confusing since it's checking env of the parent app which might not be correct.
Adds
"prepare": "npm run build"so Git installs include the built package, following npm's Git dependency lifecycle. Verified Scout installs and builds the fork automatically with its pnpmallowBuildsentry.Verified the package build and authenticated inbox listing through a real Convex development deployment. Two example type errors under Convex 1.45 remain in the unchanged context helper types.
Replaces #5 after renaming the source branch.