Repository navigation
Swarm Support - #61
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
strip_trailing_tags removed the closing tag of a trailing includefile, include or append directive, so the directive never expanded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
…write Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
…h them Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
…rkers Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
…process file tags Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
… line Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
ToolCallingAgent wrote files from model text without approval when approval_callback was None. refuse_file_tags logs a warning and tells the model in the step's observations instead, and reuses parse_tags, remove_tags and visible_control_characters. No routine for refusing a tag existed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
write_tag_file now raises AgentExecutionError when an <includefile> in <savetofile> or <appendtofile> content fails, leaving the target untouched. included_file_content does the read and raises IncludedFileError; read_included_file wraps it to keep the [ERROR: ...] text for <runcode> and <final_answer>. AgentError subclasses log when built, so none could carry the failure on the path that must stay silent; no other existing exception fits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
visible_control_characters now also writes Cf, Zl and Zp characters as \uXXXX or \UXXXXXXXX, in lower-case hex. A bidi control or zero-width character in code or a filename reached the approval prompt and the Executing code panel raw, so a terminal could show code in another order from how it runs. The translate table is built once, on first use, from unicodedata. Only displayed text changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
_compact_step_callback, the run_repl error handler and print_undelivered_steering built Rich markup strings around model, error and steering text, so a [/x] in that text raised MarkupError and ended the REPL. They now build Text with visible_encodable_text, and print_with_console_highlighting keeps the highlighting a printed string gets. visible_encodable_text is the encoding treatment AgentLogger.log_error already used, moved to bp_utils so both share it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
A ToolCallingAgent has no <runcode>, so following the sentence added to the failed-include error raised AgentParsingError. No existing member told the agent classes apart, so MultiStepAgent gains the class attribute runs_model_written_code, which CodeAgent sets to True. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
…ithout ending the REPL load_file_as_prompt and run_script caught only OSError around the read, so a file the locale encoding cannot decode raised UnicodeDecodeError and ended bpsa; a file too large for memory did the same with MemoryError. The new read_text_or_print_error prints one line naming the file and the reason and returns None; no existing helper read a file this way. load_agent_instructions and _load_readme_fallback (/instructions-load) had the same defect and use it too, so they now also name a file they skip. run_script checks the script with tokenize.open, which decodes as the interpreter does (PEP 263), so a script with a coding declaration runs. run_script decodes the script's output with backslashreplace and prints it, and both routines print the filename, as literal text: output or a path holding [/x] raised MarkupError and ended bpsa. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
run_repl discarded every exception from the autosave, so a read-only home, a full disk or memory that json cannot serialize left the user with no saved session and no message. run_repl now prints "Auto-save failed: <file>: <reason>" in yellow at each failed autosave and goes on. The success line and the failure line print the path and the exception text literally. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
… the caller's path in errors replace_file_with_text now renames a temporary file over the target only when is_replaceable_by_rename holds: the target is absent and the path is no symlink, or the target is a writable regular file of this user with one hard link and no setuid or setgid bit, and the system resolves the path to it. Every other target (device, FIFO, hard-linked file, read-only directory, name too long for the temporary file, Windows) is written in place as open(path, "w") wrote it, without the keep-previous-content property. Paths ending in a separator and symlink loops fail as open did. The temporary file has one fixed name per target, <target>.bpsa-save.tmp, opened by open_locked_temporary_file under an exclusive flock, so two processes saving the same file take turns and the next save takes over the file a killed save left. A failed save removes the temporary file only when this call created it. An error of os.replace is raised again with the caller's path. The helper takes an errors argument and encodes before it opens any file. save_session, save_answer and cmd_save_step pass "backslashreplace" in place of the unencodable_as_backslash_escapes pass, which raised UnicodeDecodeError under euc_kr; _save_aliases keeps strict encoding. No existing helper did the locking or the encoding: bytes_of_text_file, process_umask, is_path_of_open_file are new. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
…d output Slash commands printed text from outside through Rich markup, so `[/x]` raised MarkupError and ended the REPL, and `[red]` vanished and restyled the line. These lines now go through console_literal: fail, _load_readme_fallback, the queued line of SteeringListener._read_lines, change_directory, cmd_compression_model, cmd_model, cmd_session_save, cmd_session_load, and in run_repl the alias listing, alias not found, /pwd and unknown command lines. print_banner (model id), print_turn_summary (provider), print_stats (last provider), cmd_show_config (model id, compression model) and cmd_compression_stats (compression_model) take the same values as literal text. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
load_dotenv_recording_names catches a .env that cannot be read, is not valid UTF-8, exceeds memory or holds a NUL in a value, prints one line to stderr naming the file and the reason, and returns None. The line never quotes the file: for a decode error it gives the encoding only. Both loads share it: try_load_dotenv (bpsa, ad-infinitum) and the load remote_executors.py runs while smolagents is imported. read_text_or_print_error in bp_cli.py is not reused: the import-time load runs before bp_cli and its console exist. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
run_repl ran the slash-command dispatch outside any try, so Ctrl-C during /run-py, /compress or any other slash command ended the REPL with a traceback and exit code 130. run_repl now catches KeyboardInterrupt around the whole dispatch, prints "Interrupted." as the agent-run handler does, and reads the next input. No shared routine for that line existed. cmd_compress restores max_uncompressed_steps in a finally, because an interrupted /compress now leaves a live session behind. The dispatch body is only re-indented; see git diff -w. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
New module src/smolagents/bp_messages.py builds and parses from_to_id.txt message file names, validates agent names, writes a message as a .tmp file and links it to its final name under a per-sender flock, and lists the new messages for one reader given the last id read per sender. No existing routine did this; replace_file_with_text overwrites its target, which a message write must never do. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
python -m smolagents.bp_messages send|new|wait lets a person or an outside program act as the global leader. load_last_read_ids and save_last_read_ids keep a reader's last-read ids in .<reader>.read.json in the folder, and receive_new_messages loads, reads and saves them for the polling thread of T4. Reuses read_new_messages, write_message, replace_file_with_text, visible_encodable_text and get_env; no existing routine stored last-read ids. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
load_message_settings() in bp_messages.py returns BPSA_AGENT_NAME, the folders of BPSA_MESSAGE_FOLDERS with their labels (last path component) and BPSA_MESSAGE_POLL_SECONDS, or None when no agent name is set; invalid settings raise MessageSettingsError. message_folder_paths() is now the one parser of BPSA_MESSAGE_FOLDERS, also behind default_message_folder(). The REPL and bpsa run load the settings after .env loading, exit with one error line when they are invalid, and print one Messages: line when they are on; /show-config shows them. With BPSA_AGENT_NAME unset the start-up output is unchanged. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
SendMessageTool in bp_tools.py writes a message through bp_messages.write_message under this process's agent name, to an agent name or 'all', in one of the agent's message folders (named by its label; optional when there is only one). build_agent adds it only when _message_settings is set, so with BPSA_AGENT_NAME unset the tool list is unchanged. Every failure is returned to the model as one 'Error:' line and writes no file; texts above 100,000 characters are refused with advice to send a file path. bp_messages is imported inside forward, because the package imports bp_tools and a top-level import would make python -m smolagents.bp_messages warn. No existing tool did this. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
…runs MessagePoller (bp_messages.py) is one daemon thread that checks the message folders at start and then every BPSA_MESSAGE_POLL_SECONDS and queues the new messages. A failing check prints one line per folder and reason and polling continues. take_queued saves the last-read ids only when it hands the messages over, so a process that ends with queued messages receives them again. bp_cli.py starts the poller in the REPL and in `bpsa run` when the message settings are on. Messages queued before a run are appended to the task; messages that arrive during a run reach the model through agent.steering_source, after the typed steering lines, at the next step boundary. The model receives one text: a heading that says the messages come from other agents, then printable_messages, which now names the folder in each header. The user sees the delivered text, and one line when messages are queued while no run is in progress. Searched for an existing poller, timer thread or grouped message format before adding these: only printable_messages (generalised here) and the steering listener's queue existed. agents.py is unchanged. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
…eyboard run_listen waits on MessagePoller.messages_waiting, runs the agent on the queued messages (one agent and one memory for all runs, reset=False) and waits again. It needs the message settings and auto-approve on, reads no input (descriptor 0 points at the null device), writes no file under HOME and leaves redirection of its output to the caller. After the connectivity check it prints one line starting "Listening for messages: agent <name>,". A failed run, the step limit and SIGINT during a run print one line and the listener waits again. SIGTERM, and SIGINT while waiting, end it with status 0 after stopping the poller and releasing browser, GUI and MCP resources. Both signals are raised again every second until the run has ended, because the bare except of the model-call retry loop in agents.py swallows the first exception. Moved out of run_repl for reuse: new_session_stats and add_turn_to_session_stats; out of print_message_settings: message_settings_text. No existing routine waited for messages without a prompt, redirected stdin, or handled SIGTERM. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
…embers
start_agent (StartAgentTool, bp_tools.py) starts one bpsa listen process
through bp_messages.start_member. The tool names the member <own name>-<k>,
k one above the highest k that has a record, gives it one message folder,
auto-approve on, the parent's poll seconds and BPSA_MAX_GROUP_MEMBERS=0,
and starts it in its own session with stdin from the null device. The
member logs to <name>.log in its folder; .<name>.agent.json there records
process id, process start ticks, log path, start time and working
directory. The tool returns when the member prints its "Listening for
messages" line; a member that ends first, 120 s without that line, or an
interrupt stops the child and returns one Error line with the end of its
log as visible text.
BPSA_MAX_GROUP_MEMBERS (whole number, default 9) is validated with the
other message settings and bounds the live members of one agent. A member
is live when /proc/<id>/stat exists, is no zombie and has the recorded
start ticks, so a reused process id is neither counted nor signalled. With
the value 0, which every started member gets, neither tool is registered.
Beyond the task text, so that no member is left running: stop_agent(name)
('all' = every own live member; SIGTERM, 20 s, then SIGKILL), and
_shutdown_members where /exit, end of input, bpsa run and bpsa listen
already release browser, GUI and MCP resources.
message_folder_of_label now resolves the folder label for send_message and
start_agent. No existing routine started a detached process, recorded one,
or checked whether a recorded process id still names the same process.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
An agent with BPSA_AGENT_NAME set now reads in its system prompt its name, its message folders, the form of an incoming message, that messages are requests from its team which the user's own request overrides, that only the '=== message' line names the sender, and how to answer. build_agent passes message_prompt_paragraph (new, in bp_messages.py; no existing routine built such a text) as the CodeAgent instructions. The per-run heading of the grouped messages and LISTEN_TASK_HEADING keep only what the paragraph does not say. With no agent name the system prompt is byte-identical to cd0313a. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
Fixes review findings H1 and H2. content_of_regular_file opens a file of the message folder without following a symlink and without blocking, refuses a FIFO, socket, device or symlink, and refuses a file above a byte limit without reading it. Messages (600,000 bytes), last-read files (1,000,000) and member records (100,000) use it; a refused message file is delivered as the bracketed placeholder line, a refused last-read file counts as corrupt and save_last_read_ids removes it before saving, a refused record is not live. MAX_MESSAGE_TEXT_CHARACTERS (100,000) moved to bp_messages.py; write_message, the send command and the send_message tool refuse a longer text. No existing routine read a file this way. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
write_message now stores the sender's highest id in .<sender>.lock through the descriptor that sender_lock holds, after the hard link creates the message. The next id is one above the larger of the stored number and the highest id of the sender's message files, so deleting read *.txt files no longer restarts the ids and the reader no longer drops later messages. Folders written before this change (empty or missing lock file) continue above their highest file. sender_lock now opens the lock file without following a symlink and without blocking, and refuses a symlink, FIFO, directory or other non-regular file with one OSError line. Without fcntl the same code reads and stores the number, without a lock. docs/CLI.md says which files may be deleted while agents run and the one deletion that still makes ids start lower. No existing routine read or stored a small number through an open descriptor; content_of_regular_file opens by path, so it was not reused. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
… sleeping wait_for_messages(timeout_seconds) blocks a code step until at least one agent-to-agent message is queued or the time (above 0, at most 3,600 s) is over. It is registered with send_message, so members have it too. The tool reads no folder. MessagePoller.wait_until_queued sets a flag and wakes the poller thread, which then checks the folders at once and every second instead of every BPSA_MESSAGE_POLL_SECONDS; only that thread reads folders and touches _last_queued_ids. The tool writes the grouped message text into the execution log of the step (the redirected sys.stdout) and then removes exactly these batches with take_queued(batch_count), which records them as read; it returns the number of messages, so a print of the result never shows a message twice. It never writes to a terminal: when sys.stdout is not the StringIO of the exec executor, or the text has more than 10,000 characters, the messages stay queued for the delivery between steps. message_prompt_paragraph has one more sentence; docs/CLI.md one more row. With BPSA_AGENT_NAME unset the system prompt and the tool list are byte-identical to 41dd4b2. No existing routine waited on the poller with a time limit or took part of its queue; run_listen waits on messages_waiting without a limit. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
start_agent takes an optional last argument count. bp_messages.start_members (which replaces start_member) checks the member limit and the available memory for the whole call, fixes the consecutive names, launches every child and writes its record, and then waits for all of them together. Members that listen stay; a member that ended, timed out or could not be launched is stopped and reported in its own line. An interrupt during launch or wait stops every child of the call. No existing routine started or awaited more than one member, and none read /proc/meminfo; available_memory_bytes is new. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
wait_for_messages recorded a message as read when it printed it into the step's execution log. An interrupt later in the step discarded the log and the message was lost (M-a); a text too long to print was counted but not shown and made every later call return at once (M-b); several waits could push printed messages into the cut of the execution log (M-c). A printed message now stays queued. A step callback hands the finished step's observations and error text to MessagePoller.record_printed_as_read, which records the messages that text holds; all others are delivered between steps, with the next task, or after a restart. The tool returns the number of messages it printed, prints only into the first 10,000 characters of the log (the part truncate_content always keeps), and a later call in the same step waits for newer messages. No existing routine did this; take_queued(batch_count) and queued_batches, which only the tool used, are removed. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
…the step for a message that cannot be printed Review of 437e96f, findings M-1, M-2, L-1, L-2, L-3. M-1: the step callback saved the read ids before _run_stream appended the step to memory, so an interrupt or exception in a later step callback lost the message, also after a restart. The callback now only marks the printed messages (MessagePoller.mark_printed_as_shown). record_shown_as_read removes them and saves the ids only when the marked step object is in agent.memory.steps: before the next step (steering source), at the next step's end for agents without a steering source, and after agent.run in the REPL and in bpsa listen. bpsa run does not record the messages of its last step. agents.py is unchanged. M-2: wait_for_messages returned 0 both when nothing arrived and when a message arrived that it could not print, so a loop that counts replies never ended. The tool now raises CodeStepEndedForMessages in the second case: the code step ends, its error text says how many messages wait, and they are delivered right after the step. A further call in the same step raises again at once. An invalid timeout and a call before the poller exists raise too. 0 means only that no message arrived in the given time. Tool description, docs/CLI.md and stale comments rewritten; the listener's SIGTERM line excepts the messages a wait printed in the step in progress. No existing routine did the two-stage recording; the earlier record_printed_as_read is split into the two routines above. Not fixed: with executor local, agents.py raises UnboundLocalError on every exception of a code step, so the tool's exception ends the run there and the messages arrive with the next task. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
A reset request is an empty file from_to_id.reset in a message folder, written by `python -m smolagents.bp_messages reset --to <name|all>` or by the new tool reset_agent(name, folder?). write_message, the send command and send_message always build .txt, so no message text resets an agent. The poller thread of bpsa listen records the request and sends SIGUSR1 to the main thread; the existing signal handler raises ListenResetSignal (raised again every second, as for SIGTERM) while the main thread waits for messages or runs the agent. The listener then replaces its agent as /clear does, discards the messages queued before the request and the sender's earlier ones, and answers the sender with a "Reset done:" message written by code. Session totals, budget, name, folders and last-read ids stay; members keep running and are named in the first task after the reset. The REPL and bpsa run answer "Reset refused:" and keep their context. No existing routine cleared a listener's context: /clear is inline in run_repl, so run_listen repeats its five calls. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
…urvive a missing folder take_pending_resets now discards only the messages queued before the earliest pending request and the lower-id messages of each request's sender in its folder; every other message stays queued for the fresh context, and the read ids saved per folder stop below the first kept message of each sender. With several requests the confirmation states the total of that one replacement. The poller records the reset requests of its first listing of a folder as read without carrying them out, refusing or confirming them: a process that has just started has a fresh context. A refused request is recorded as read. After a reset, a folder that cannot be listed adds no member to the members line and is named in one log line; the listener goes on. reset_agent's description and docs/CLI.md say what a missing answer usually means and that a member has no reset_agent tool. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
python -m smolagents.bp_messages gains four commands, so that a program that can only run shell commands starts bpsa listen agents, sees their state without a model call and stops them. start calls start_members; stop calls stop_members; nothing in them assumed a living bpsa starter, so they are reused as they are. start_members and launch_member take further_folders and member_limit (defaults keep start_agent unchanged), so a started agent can lead its own group. The record gains message_folders and max_group_members. bpsa listen writes .<name>.status.json in each of its folders at each change of state (starting, idle, busy, resetting, ended) with runs done and tokens. status joins it with the liveness test of the process that wrote it, so a killed process is shown as ended, never as busy. Searched for existing routines first: the folder checks, the safe write of a hidden file and the listing of hidden files existed inline and are now message_folders_of_paths, replace_hidden_file_with_text and agent_names_of_hidden_files; no routine for a status file or for printing records existed. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
…'s members in the same stop take_pending_resets now brings each kept batch's read ids up to the ids it saves for the folder, so delivering a kept batch no longer marks a discarded message as unread again. stop_members waits up to 2 s after SIGKILL until the process is gone, so stop_members_left_by finds and stops the members of a leader that had to be killed. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015UHqhverPAoiTvp8HHjVFM
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.
No description provided.