Skip to content

truss watch --no-sleep#2211

Open
daanielww wants to merge 3 commits intomainfrom
danielw-no-sleep-watch
Open

truss watch --no-sleep#2211
daanielww wants to merge 3 commits intomainfrom
danielw-no-sleep-watch

Conversation

@daanielww
Copy link
Contributor

@daanielww daanielww commented Feb 6, 2026

🚀 What

Add new truss watch --no-sleep which starts up a keep-alive thread in the background that pings the development model's readiness endpoint to prevent it from scaling down

💻 How

Local E2E testing + unit tests

🔬 Testing

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e97eeaa877

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +932 to +934
# Wake the model in case it's scaled to zero
wake_url = f"{model_hostname}/development/wake"
api_key = remote_provider._auth_service.authenticate().value

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Normalize model hostname before building keepalive URLs

If resolved_model["hostname"] is a bare host (e.g. the repo’s tests and API mocks use values like host.baseten.co/hostname without a scheme), then f"{model_hostname}/development/wake" (and the later keepalive URL) becomes an invalid URL and requests raises MissingSchema. That means --no-sleep will never successfully wake/keepalive and will eventually exit after 20 failures. Consider normalizing the hostname (e.g. prefix https:// when missing) or reusing a URL builder that guarantees a full scheme.

Useful? React with 👍 / 👎.

@daanielww daanielww requested a review from nnarayen February 6, 2026 17:39
sys.exit(1)

# Wake the model in case it's scaled to zero
wake_url = f"{model_hostname}/development/wake"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Should we log here too? Something along the lines of 'Model currently inactive, waking.'

"[bold green]Waiting for development model to be ready..."
) as status:
while True:
time.sleep(1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Thoughts about making this slightly less aggressive? Agreed it's a balance between appearance of quickness to user and risk to our servers

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

current --wait functionality also uses a 1s sleep for fetching for status but yes I'm ok with increasing this value

@nnarayen nnarayen force-pushed the danielw-no-sleep-watch branch from 81f8417 to ecef162 Compare February 9, 2026 19:08
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.

2 participants