Add supervised R workers and structured handoffs - #210
Merged
Merged
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.
Long R computations need an enforceable deadline without delivering a delayed interrupt into the host's next operation. Sessions can now opt into
run_r_mode = "worker", with one persistent callr worker per session. Timeouts interrupt that worker and report whether partial state survived; unresponsive workers are terminated.skill_timeoutnow reaches ordinary and self-bounded tools. Supervised R calls also respectskill_timeout_maxand an optionalsession$run_r_timeout_capcallback for changing host deadlines. Worker-owned handles and subagentreturn_nameartifacts resolve in their owning process. Host checkpointing preserves nested helpers and shared environment references, and bounds checkpoint writes too.Subagent queries may opt into
report = TRUEfor structured status, notes, findings, concerns, deviations, open questions, and feedback. Reports remain readable in the ordinary character reply and are also available as structured metadata. Timeout guidance advises inspecting state and improving, splitting, parallelizing independent work, or approximating the computation before retrying.Compatibility: in-process execution remains the default;
tool_run_r(code, envir)is unchanged; existing positional arguments and two-argument custom executors keep working. New report arguments are appended and default to false.Verification: the complete offline installed suite passes 4,734 assertions; the final worker tests pass 60/60. Focused subagent, schema, observer, timeout, and positional compatibility tests pass. CI dependency installation preserves its built-in GitHub token through sudo to avoid anonymous download rate limits.