Repository navigation
Fix eight session-analysis defects in questions, waits, pipelines, git and the command hint - #4226
Merged
Merged
Conversation
netzenbot-reviewer
requested changes
Nov 15, 2026
…ed confirmer A delegate's question that the permission mode answers without a person (bypass or accept-edits approvals, plan-mode and read-only refusals) is decided when it is asked and no longer queues behind another run's open question. Confining exposes those answers as Unasked, Lent::confirming records the view when the confirmer is lent, and Borrowed::asked refuses a stopped delegate first, then takes the mode's answer, then takes the lock for a question that reaches a person. The mode is read when the question is decided, so a change while another question is open applies. DELEGATE-16 and DELEGATE-25 say so and cite the new tests. Closes brave#4164
netzenbot
force-pushed
the
fix-session-analysis-nov14
branch
from
November 15, 2026 05:20
4e47f16 to
fca839e
Compare
netzenbot-reviewer
approved these changes
Nov 15, 2026
A job_output call that names a background job of the turn, carries a wait_seconds the tool accepts and does not kill the job is treated as a different call from the ones around it. The count starts again and the call is never held, asked about or recorded in the trail. The decision reads the planner's own tool name and arguments, through the argument gate, and the driver's own observation that the job process has not exited. It never reads what the job printed. A job_output call with no wait_seconds, with a refused wait_seconds, that kills the job, or that names an ended or unknown job is counted and held as before. Bypass still passes the held-call question on; the change removes the question for bounded waits. The refusal for a repeated call names the tool and the count and gives a route chosen from the tool name. For job_output it says the end of a background job is reported in a message of its own and that a shell loop that sleeps is not a way to wait. The job_output description says what is and is not held. TURN-9, the website pages and the pinned count of Policy::read_planner_argument sites are updated, and each new test is a verified-by line of TURN-9. Closes brave#4167
A caller that builds a Task says which front end the person is using: the terminal client, the desktop app, or an editor hosting the session over the Agent Client Protocol. The system prompt then carries one fixed sentence for it, pushed as driver text on the person's side only, so a delegate is not given it. The value is a closed enum the caller supplies, never read from a file, a tool result or the session record, so a session resumed in another front end names the one now in use. A caller that says nothing, as a one-shot, goal or manifest run does, has no sentence. Specs INSTR-9 and acp.md and the website instructions page state it. Closes brave#4165
A step of a pipeline that SIGPIPE ended because a later step of the same pipeline closed its input and exited 0, as `yes | head -n 3` does, is recorded as closed by the next step. The run counts as having succeeded, the ending sentence says it exited 0 and which step stopped because the next step closed its input, and no confinement sentence follows. Any other signal, and SIGPIPE with no later step that exited 0, is still a failed step. Foreground pipelines, substitutions and background jobs share the rule. The decision is read from the exit codes, the signals and the steps places only. Closes brave#4166
…s what can read a larger one A diff reads a side up to 4 MiB and compares only the lines between the first line that differs and the last, with three lines of context kept at either end. A one-line change in a file past 1 MiB prints its hunk at the line numbers the file has, in a diff and in the show of a commit. A side past 4 MiB is described by its size. The notes for a file past the diff cap and past the search cap name read_file on the working copy and run, each only where the turn's list holds it, as the note of a show of a file does. Out::instead holds the wording for all three. GIT-1, GIT-9, GIT-14, TOOL-6, the known costs in labels.md and the website page describe the new bound and notes. Closes brave#4168
git rebase -i is no longer refused when the same line assigns GIT_SEQUENCE_EDITOR or GIT_EDITOR to a literal command, or passes -c sequence.editor= or -c core.editor=. GIT_EDITOR and core.editor also let a git commit with no message through. An empty value, a computed value, a value naming a terminal editor, and an assignment in front of another step or another variable name no editor. The subcommand is found past -c and -C options. The refusal of git rebase -i names GIT_SEQUENCE_EDITOR, git rebase --autosquash and git commit --fixup=reword as the routes that work. CMDLINE-15, the run tool reference and the command line overview describe this. Closes brave#4170
…est and that calling the tool again returns it The stub that replaces an old tool result said the call ran and its result was shown earlier, so a planner that could not see the text believed it still held it and worked from memory. The stub now says the result is no longer in the request, that calling the tool again returns it (for a read, only the lines needed), and that a call which changes something is not to be repeated. The sentence is the same for every tool and for results sent by id or as prose, and it carries the tool name and size only, as before. COMPACT-18 states the content and lists the tests that pin it, and the sessions page says the same. A read repeated after its result was dropped sends the lines and not the notice that the file has not changed. Closes brave#4171
A command the table gives no argument, typed with words after it, is a prompt (CMD-2): `/model gpt-5` opens no picker and `/undo the last change` undoes nothing. The line is sent at the first Enter, and until now nothing on the screen said so while the turn ran. The session marks a turn begun on such a line, from the line the person typed in the box or from a single queued line, and clears the mark when any other turn begins. While that turn runs the row under the box says "Prompt sent; ctrl-c stops it; bare word runs it", at the right like the leave words' note and no wider than it, so one permission mode name and the vi mode still fit beside it on eighty columns. Whether a line qualifies is read off the command table's argument column by command_table::is_a_command_given_words, so a command added with no argument is covered without a second list. The bare command, a command that takes an argument, a longer word such as /models, a prompt that only mentions a command, a line sent in shell mode and lines sent together by Ctrl-Enter are not marked. CMD-2 and CMD-17 state the behaviour and list the tests that pin it, the command reference and interactive-mode pages say it, and the note is in the en-US and fr catalogs. Closes brave#4172
netzenbot
force-pushed
the
fix-session-analysis-nov14
branch
from
November 15, 2026 05:48
fca839e to
b73f687
Compare
bbondy
approved these changes
Nov 15, 2026
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.
Closes #4164
Closes #4165
Closes #4166
Closes #4167
Closes #4168
Closes #4170
Closes #4171
Closes #4172
User impact: a command typed with words after it (
/model gpt-5) now says on screen that it was sent as a prompt, and the planner, shell, git and job tools stop refusing or misreporting five ordinary cases.Decisions to confirm
crates/agent/src/permission_mode.rs.Frontvariant. One-shot, goal and manifest runs and delegates are not told. To reverse: add the variant and map it.a | b | headwherebfails,ais reported as closed, andkill -13 $$ | trueis forgiven. The!prompt has the same shape and is unchanged. To reverse: tightenexec.rsaround line 360.until_exitis exempt from the repeat count even though it can return at once. A held call is refused with nobody asked. To reverse: removeJobs::is_waited_on_while_running.vim, names no editor and stays refused. TheGIT_EDITOR=assignment is always asked about, and an allow rule such asBash(git *)already covers the-cforms, so no new class of exposure is added.The problem
#4164. A delegate's question the mode answers waited behind another run's open question.
#4165. The planner was not told which front end it runs in.
#4166. A pipeline ended early by
headprinted the right lines and reported a step as failed.#4167. The third bounded wait on a running job in a row was refused as a repeat.
#4168. A large file's diff got a size-only note.
#4170. A git line that sets its own editor was refused as needing a terminal.
#4171. A dropped tool result's stub did not say the result was gone.
#4172.
/model gpt-5started a model turn with nothing on screen saying so.Reproduce
#4172:
BRAVE_AI_CHAT_ENDPOINTat it, withHOMEandBRAVEBOT_HOMEin an empty directory.nto the trust prompt./model gpt-5and press Enter.The row under the box now reads, at 120 columns:
and at 80 columns:
Before the change the hint row was empty. The replay tool reported one sequence it does not model, so the screen may differ slightly from a real terminal, and blank lines are trimmed.
The other seven items
None has a screen, so the tests are the reproduction and fail on the parent commit:
cargo test -p bravebot-agent --lib is_waited_on(#4167),cargo test -p bravebot-agent --test turn(#4164, #4166, #4167),cargo test -p bravebot-agent --lib cmdline(#4170),cargo test -p bravebot-agent --lib conversation(#4171) and theread_gittests undercrates/agent/src/git(#4168). The #4166 turn tests useyes | head -n 3and akill -9stub, not theseq | sort -rn | headline.The fix
#4164. A question the mode answers is read through a view that does not take the shared confirmer.
#4165. The system prompt gets one sentence naming the terminal, desktop or editor front end.
#4166. A step ended by SIGPIPE with a later step of the pipeline that exited 0 counts as closed, and as a success.
#4167. A bounded wait on a running job is passed without counting.
#4168.
read_gitdiffs a side up to 4 MiB over the changed lines plus 3 lines of context.#4170. A git line that names its editor outright is not refused, and the refusal text names the working routes.
#4171. The stub is one fixed sentence.
#4172. A no-argument command typed with words after it draws the note while its turn runs.
Verification
crates/agentis not a cratemake check-verusreads (contrib/check-verus.pyverifies onlycrates/core), soRegion::ofincrates/agent/src/git/diff.rshas no Verus contract. It slices and subtracts on offsets summed from the lengths of lines of two blobs read from the repository. A contract would state, foroldand again fornew:old_from <= old_head <= old.len() - old_tail <= old_to <= old.len();old;skippedis the same count of leading lines on both sides.The first holds because the tail is counted inside
old_rest, soold_head + old_tail <= old.len(), and the context taken back fromold_headnever exceedsold_head.Test plan
BRAVEBOT_ALLOW_UNCONFIGURED_BUILD=1 make check-affected: passed onda6a9345f. The branch was then rebased ontoupstream/maina203a8f1dwith no conflicts. The upstream commits since the gate touchcrates/tuiand the locale files that /model followed by a model name starts a model turn with nothing on screen saying it went to the model #4172 also changes, so CI is the check for the rebased head.make check-specandcargo fmt --all --checkpassed on the pre-rebase tree.check-reviewdogexits 2 with no findings (the opengrep runner). Aui/scripts/language.test.mjstiming test passes alone, and the diff does not touchui/.--plainis untested; A pipeline step ended by SIGPIPE behind head is reported as 'It failed: step N was killed' for a complete result #4166 has no multi-pipeline,&&or||test; A fourth wait on one long background job is held as a repeated call and stalls the turn for 23 minutes #4167 has no delegate test; read_git prints no diff for a commit touching a file over 1 MiB and its note names no other way to read it #4168 has no test at exactly 4 MiB; git rebase -i is refused even with GIT_SEQUENCE_EDITOR set, and the refusal names no working route #4170 has an assertion the reword route also satisfies; /model followed by a model name starts a model turn with nothing on screen saying it went to the model #4172 has no prompt-file test.check-untranslatedlists those sentences.