Skip to content

Add configurable HTTP timeout for Bun and Tailwind CLI downloads#150

Merged
hayleigh-dot-dev merged 5 commits into
lustre-labs:mainfrom
ashuklaa:feature/custom-network-timeout
Dec 26, 2025
Merged

Add configurable HTTP timeout for Bun and Tailwind CLI downloads#150
hayleigh-dot-dev merged 5 commits into
lustre-labs:mainfrom
ashuklaa:feature/custom-network-timeout

Conversation

@ashuklaa

@ashuklaa ashuklaa commented Nov 26, 2025

Copy link
Copy Markdown
Contributor

Exposes the HTTP request timeout used when downloading Bun and Tailwind as a cli flag and a toml config option under [tools.lustre.bin].

Fixes #149

Changes

  • Added flag read functionality that pulls timeout from cli flags primarily with the user’s gleam.toml [tools.lustre.bin].timeout as the secondary location, defaulting to 60000ms if neither are present.
  • Updated Bun and Tailwind download functions to call httpc.timeout(timeout) using this value.
  • Documented timeout flag in the TOML reference.

Testing Methodology
Created a small Gleam project with lustre_dev_tools as a local dev-dependency.

Added to gleam.toml:
[tools.lustre.bin]
timeout = 120000

Ran:
gleam run -m lustre/dev add tailwind
Screenshot 2025-11-25 at 7 49 14 PM

gleam run -m lustre/dev add bun
Screenshot 2025-11-25 at 7 47 25 PM

Confirmed that configured timeout value was used by testing with timeout = 10, received ResponseTimeout error as expected:
Screenshot 2025-11-25 at 7 50 12 PM

@hayleigh-dot-dev

Copy link
Copy Markdown
Contributor

Thank you for this! Do you think you could use the approach that other config options are using by using the cli module: that way we'd get a command-line flag for free too :)

Could we also name the option just timeout!

@ashuklaa

ashuklaa commented Dec 1, 2025

Copy link
Copy Markdown
Contributor Author

Sure, no worries! This was my first shot at an open source contribution so I appreciate your patience.

I read through the flag config for build and start and redid my implementation through the cli module, and tested to ensure that toml and cli flag based configs were respected:

Screenshot 2025-11-30 at 6 22 45 PM Screenshot 2025-11-30 at 6 23 33 PM

I also found that the download function for bun/tailwind was being used by the build and watcher functions so those now also respect toml based timeout flags.

Let me know if there are further changes required!

@ashuklaa

Copy link
Copy Markdown
Contributor Author

Hi @hayleigh-dot-dev just realized I forgot to follow up on this and ask if there were any further enhancements needed but just checking in! Happy holidays!

Comment thread src/lustre_dev_tools/bin/bun.gleam Outdated
Comment thread pages/toml-reference.md Outdated
@ashuklaa

Copy link
Copy Markdown
Contributor Author

Resolved concerns regarding timeout logic, switching to seconds-level control instead of ms, and removed verbose console logging

@hayleigh-dot-dev

Copy link
Copy Markdown
Contributor

Looks wicked, thank you!

@hayleigh-dot-dev hayleigh-dot-dev merged commit 107ca82 into lustre-labs:main Dec 26, 2025
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.

Add a timeout config option to set the download timeout for binaries.

2 participants