fix(pebble): surface timeout budget in system prompt#91
Merged
Conversation
The Pebble webhook enforces a hard wall-clock timeout (CLAYDE_PEBBLE_TIMEOUT, default 300s) but never told Claude about it, so the agent could take on work too large to finish and get killed mid-task with no result for the user. build_system_prompt now takes timeout_s and states the budget in the prompt: process is killed on overrun, prefer a smaller complete action, and report the most valuable partial result in the JSON summary if the task is too big. worker.py passes the configured timeout through. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Problem
The Pebble webhook enforces a hard wall-clock timeout (
CLAYDE_PEBBLE_TIMEOUT, default 300s) on each Claude CLI invocation, but the system prompt never mentioned it. The agent had no way to know its budget, so it could take on a task too large to finish — and get killed mid-run, leaving the user with no result.Change
skills.py—build_system_prompt(skills, timeout_s=300)injects the budget into the prompt: the request has N seconds, the process is killed on overrun, prefer a smaller complete action over an ambitious one, and if the task is too big, do the most valuable part and say so in the JSON summary.worker.py— passes the configuredtimeout_s(already in scope fromCLAYDE_PEBBLE_TIMEOUT) into the prompt builder.test_prompt_mentions_timeout_budget; two monkeypatch stubs updated for the new signature.Default
timeout_s=300(matches the config default) keeps existing call-site tests green; the worker always passes the live configured value.Verification
uv run --extra dev pytest— 364 passed.🤖 Generated with Claude Code