Repository navigation
session+app: paged reads stay the chat's own; a reply to an open question is never refused - #2832
Merged
Merged
Conversation
…s "empty" is checked The read sweep keyed each `read` by its whole arguments, so paging through one long file counted every window as a new target. In run7 a canvas manager paged its canvas skill to the third window, the rest went to a quick task holding only the four readers, and that task reported a canvas with two parts on it as empty. The chat asked the person what the deck was about instead of building. A `read` is now keyed by its path, so one file read a window at a time stays the chat's own reading. The reader is told that what only a program shows is outside its reading and must never be called empty, and the chat's lead on a handed-off answer says such a claim is unchecked until it checks it. Assisted-by: CodeAF Co-Authored-By: CodeAF <[email protected]>
…'s reply, never refused A turn held on the model's own question is still a running turn, so a message the desktop app sent to it was refused with "this agent is already working on a turn" while the question sat on screen asking for exactly that message (run7's board deck). The app sends, rather than steers, to a turn waiting on the person. A send to a running turn with a question open now goes down the steer's road: the engine retires the model's question and hands the words to the model at once. A running turn with nothing asked still refuses, as before. The manual's questions and screen pages say both this and how a reading is handed off. Assisted-by: CodeAF Co-Authored-By: CodeAF <[email protected]>
Assisted-by: CodeAF Co-Authored-By: CodeAF <[email protected]>
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.
Fixes one run7 board-deck turn that broke in two ways (t1 1.4, t2 1.0; evidence in
run7/shard-2/.../cv_ynrb3bhhdm5l.../01M7SEE7XJ9D0DKAN22C1P1QNZ, engine ca6a3af).1. The quick task said the canvas was empty
Root cause. The read hand-off (
internal/session/readhandoff.go) keyed eachreadcall by all of its arguments. The manager read its canvas skill in windows (no offset, then 790, 1190, 1590), and the sweep counted each window as a separate target. On the third window it handed the rest of the skill to a quick task. That task has onlyread/grep/find/ls. It sawcanvas.dbas a file, could not runcanvas show, and answered "canvas.db holds no frames". The canvas actually had two. The chat took that answer as fact and asked the person what the deck was about.Fix:
readis now keyed by its cleaned path alone. One file read in pages counts as one target, which is the existing rule ("one file stays a step"). Three different files still get handed off.prompts/reading.mdnow say:2. "Not sent · this agent is already working on a turn"
That string comes from the engine (
cmd/codeaf/app.gostartTurnLocked), not the desk. The desk deliberately callsagents.send, not steer, when a turn is waiting on a question (canvasChatDeps.runningNowexcludes asks). The engine saw the turn as running and refused the send.Fix:
sendLockednow routes a send to a running turn that has a question open down the steer's road (steerRunning, split out ofsteer). The engine retires the model's ownaskand hands the words to the model at once (steerquestion.go). A running turn with nothing asked still refuses. No desk change is needed (recorded as plandb context c-6vzs).What a person sees
Tests
TestPagingOneSkillStaysTheChatsReadingAndItSeesTheCanvas: a fake-model replay of the run7 turn (four windows of one skill, then the command that shows the canvas). No task is started, every window reaches the chat, and the chat's own command shows both parts. Red on the base: 1 task started, and the canvas look was refused with "this reading can only look".TestReadSweepPagesOfOneFileAreOneTarget,TestReadHandoffSaysWhatTheReaderCouldNotSeeTestAppSendWhileTheTurnWaitsOnAQuestionIsDeliveredNotRefused: real engine over loopback with a scripted model that callsask. ASendwhile the ask is open is accepted, the ask closes, the steer entry carries the client id, and the model's next request contains the reply. Red on the base:busy: this agent is already working on a turn.make test-focus(session read-handoff/steer/question/manual, cmd/codeaf send/steer/queue/ask): ok.flock /tmp/codeaf-prready-queue.lock make pr-ready BASE=origin/canvas/connected: exit 0.cmd/codeaf: three factory tests failed once and passed on the rerun, so the classifier marked them flaky:TestAppFactoryPlanFilesAnswer/structured_safe,TestAppFactoryRunnerProviderReplacementKeepsLease,TestTheOwnersClosingALentStageEndsTheAppViewAndAResumedStageIsLentAgain.internal/session:TestTheFixedPrefixStaysUnderItsBudgetalso fails on the base, at the same 52510 bytes, 13 over the 52497-byte budget. This PR does not touch the main prompt or the tools.Manual:
questions.md(a typed reply to an open question in the desktop app) andscreen.md(when a reading is handed off, why a paged file never is, and what the reader cannot see). Change entry:docs/changes/unreleased/2832-paged-reads-and-open-question-replies.md.