Skip to content

mail: an env-selected SMTP driver's timeout cannot be raised #1177

Closed

Description

@sebyx07

Found in plan 101b sweep 8b-4. selectMailDriver (packages/mail/src/driver-env.ts) builds smtpMailDriver() with no timeoutMs, and no environment variable sets one. An app on the env-selected driver therefore cannot raise the SMTP timeout; only an app building smtpMailDriver({ timeoutMs }) itself can. The fix line now says that, but the gap is the design.

Decide: a MAIL_TIMEOUT_MS-style variable read by driver-env.ts (registered in the framework env list) or an app.config.ts key.

🤖 Generated with Claude Code

Activity

  1. developerz-ai commented on Nov 17, 2026

    @developerz-ai
    Contributor

    Thanks — that's a real gap, and not just a docs one. selectMailDriver forwards MAIL_POOL_SIZE to the SMTP driver but never timeoutMs, so an app on the env-selected path can't raise the deadline and the only workaround is building smtpMailDriver yourself, which drops the rest of the selection logic (the two-credential refusal, MAIL_FROM, retainMime). Scoping the fix now.

    🤖 Posted by developerz.ai — an automated agent, not a human.

  2. developerz-ai commented on Nov 17, 2026

    @developerz-ai
    Contributor

    Scope — packages/mail/src/driver-env.ts: an env-selected SMTP driver cannot set a timeout.

    Design call: an env key, MAIL_TIMEOUT_MS — not an app.config.ts field. packages/mail/CLAUDE.md and wiki/Configuration.md both state a transport is selected from the environment, never from config, because nothing loads app.config.ts's contents at runtime; a mail.timeoutMs field would be a setting no boot could read. That is the same law MAIL_POOL_SIZE already follows.

    Work

    1. Add MAIL_TIMEOUT_MS to MAIL_ENV_KEYS (driver-env.ts), beside MAIL_POOL_SIZE.
    2. Parse it at the boundary, the way poolSizeFrom does: a non-integer, zero or negative value is X_CONFIG_INVALID naming MAIL_TIMEOUT_MS and the edit to make — never a silent fallback, never a NaN that reaches setTimeout.
    3. Forward it as timeoutMs to smtpMailDriver on the SMTP_URL branch. Unset ⇒ omit the option, so smtpMailDriver's own 30_000 default is unchanged.
    4. Test in driver-env.test.ts: a custom value reaches the driver, unset stays at the default, and an invalid value is refused with the key named.
    5. Document the key in packages/mail/README.md's selection table and the wiki Mail page.

    Not in scope: SES and Resend timeouts. driver-env.ts forwards none for them today and the issue is about SMTP; if their deadlines need the same treatment that is a separate ask.

    🤖 Posted by developerz.ai — an automated agent, not a human.

  3. developerz-ai commented on Nov 19, 2026

    @developerz-ai
    Contributor

    Make the env-selected SMTP driver's timeout configurable

    • Picked up
    • Surveying the repo — 2026-11-19 01:02 UTC
    • Working
    • Pull request opened
    • Done

    Stopped — this needs a human. Nothing was merged.
    Reason: the run stopped on an error; its details are on the run in the developerz.ai dashboard.

    32m · 4 tool calls


  4. developerz-ai commented on Nov 19, 2026

    @developerz-ai
    Contributor

    Tracking pull request #1261 for this issue.

  5. developerz-ai commented on Nov 19, 2026

    @developerz-ai
    Contributor

    Attempt 1 of 3 ended: the work ended failed with no change merged.

    It has been filed again as attempt 2 of 3, carrying what the last one hit.

    What stopped it:

    • evidence_blocked: The run recorded inaccessible evidence and stopped without shipping a change. It will not retry automatically: restore access to the recorded sources and rerun the task.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions