Make worker startup timing configurable and harden marker correlation#27
Draft
jacoblyles wants to merge 1 commit intomainfrom
Draft
Make worker startup timing configurable and harden marker correlation#27jacoblyles wants to merge 1 commit intomainfrom
jacoblyles wants to merge 1 commit intomainfrom
Conversation
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.
Summary
This PR addresses reliability issues observed in OpenClaw -> Claude -> Maniple -> worker flows.
1) Configurable startup timing
Adds a new
startupconfig section:startup.agent_ready_timeout_seconds(default30)startup.marker_poll_timeout_seconds(default30)These values are now used by
spawn_workersfor:Also adds config CLI support and env overrides:
MANIPLE_AGENT_READY_TIMEOUT_SECONDSMANIPLE_MARKER_POLL_TIMEOUT_SECONDS(and legacy
CLAUDE_TEAM_*fallbacks)2) Marker correlation fallback (Claude/tmux)
When direct
await_marker_in_jsonl(...)correlation fails for Claude workers,spawn_workersnow attempts recovery via tmux pane marker scanning (find_jsonl_by_tmux_id).This avoids hard dependence on the worker replying
Identified!in cases where a worker model treats the marker message as suspicious/prompt injection.3) Better startup failure diagnostics
On tmux startup timeout, include a tail excerpt of recent pane output in the raised error message. This makes failures actionable (e.g. auth/model errors, update screens) without requiring manual pane capture.
4) Marker prompt wording hardening
Updates marker instruction text to explicitly identify the marker block as an orchestrator system handshake.
Why
In real runs, worker startup failures were hard to distinguish and marker correlation was brittle for some Claude workers. These changes preserve existing defaults but provide:
Validation
Ran targeted tests:
uv run pytest -q tests/test_config.py tests/test_config_cli.py tests/test_spawn_workers_defaults.py tests/test_session_state.py124 passedAlso checked lint for touched files:
uv run ruff check ...Notes
Defaults remain unchanged (
30s) to preserve current behavior unless users opt in to different values.