Skip to content

Add an env variable to allow delaying startup of external services #5613

Closed

Description

@DanTup

There's currently an issue on Firebase Studio that prevents services that bind to ports really early on in the activate() method from being reachable correctly from the front-end. As a workaround while this is debugged, we should support a custom delay before we spawn things like DTD.

To avoid cluttering the users User or Workspace settings with this, we'll use an env variable that contains the number of milliseconds to delay startup of these services:

DART_CODE_SERVICE_ACTIVATION_DELAY=5000

cc @keertip


Edit: Let's also support a hidden setting for this to simplify testing on cloud IDEs.

Activity

  1. added this to the v3.116.0 milestone on Jul 28, 2025
  2. added
    in remoteRelates to running the extension in a remote setting using VS Code's remote dev support
    is enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.
    on Jul 28, 2025
  3. DanTup commented on Jul 28, 2025

    @DanTup
    MemberAuthor

    As well as the env var, a config setting can be used:

    "dart.serviceActivationDelayMs": 3000,

    The config setting is not declared, so VS Code will say that it's not valid, but it will still work (this exists just for convenience of testing).

    The config value overrides the env var (to allow for testing different values even if the platform is setting the env var).

  4. keertip commented on Jul 30, 2025

    @keertip
    Contributor

    Danny, how about tweaking this a little bit? Instead of looking for DART_CODE_SERVICE_ACTIVATION_DELAY, look for MONOSPACE_ENV environment variable. If that is set to true, then it is Firebase Studio, and then we can delay the activation by the default value, which would be 5 secs.

  5. DanTup commented on Jul 30, 2025

    @DanTup
    MemberAuthor

    @keertip I have pushed 4be3390 which adds a default delay of 5s based on that env variable. It can still be overridden by the config setting or the DART_CODE_SERVICE_ACTIVATION_DELAY env variable to make it easier to test other values.

  6. keertip commented on Jul 30, 2025

    @keertip
    Contributor

    Thanks Danny, that looks good!

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

    in remoteRelates to running the extension in a remote setting using VS Code's remote dev supportis enhancementAn enhancement or improvement that should be listed in release notes but is not a bug fix.on cloud ide

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions