Skip to content

session+app: paged reads stay the chat's own; a reply to an open question is never refused - #2832

Merged
santoshkumarradha merged 3 commits into
canvas/connectedfrom
canvas/connected-quick
Nov 19, 2026
Merged

santoshkumarradha merged 3 commits into
canvas/connectedfrom
canvas/connected-quick

Conversation

@santoshkumarradha

@santoshkumarradha santoshkumarradha commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

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 each read call 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 only read/grep/find/ls. It saw canvas.db as a file, could not run canvas 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:

  • A read is 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.
  • The reader's brief and prompts/reading.md now say:
    • it cannot run a command;
    • it must never call something only a program shows (database rows, a running program) empty or missing;
    • it reports what the reading found and leaves the reply to the person to the chat.
  • The chat's lead on a handed-off answer now says such claims are unchecked and that the chat should check them itself before acting.

2. "Not sent · this agent is already working on a turn"

That string comes from the engine (cmd/codeaf/app.go startTurnLocked), not the desk. The desk deliberately calls agents.send, not steer, when a turn is waiting on a question (canvasChatDeps.runningNow excludes asks). The engine saw the turn as running and refused the send.

Fix: sendLocked now routes a send to a running turn that has a question open down the steer's road (steerRunning, split out of steer). The engine retires the model's own ask and 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

  • A canvas manager that pages through its skill keeps reading it itself, then looks at the canvas.
  • Typing a reply while the agent's question is open is taken as the answer. It is never refused.

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, TestReadHandoffSaysWhatTheReaderCouldNotSee
  • TestAppSendWhileTheTurnWaitsOnAQuestionIsDeliveredNotRefused: real engine over loopback with a scripted model that calls ask. A Send while 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: TestTheFixedPrefixStaysUnderItsBudget also 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) and screen.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.

santoshkumarradha and others added 3 commits November 19, 2026 03:52
…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]>
@santoshkumarradha
santoshkumarradha marked this pull request as ready for review November 19, 2026 09:26
@santoshkumarradha
santoshkumarradha merged commit 97c890c into canvas/connected Nov 19, 2026
1 check passed
@santoshkumarradha
santoshkumarradha deleted the canvas/connected-quick branch November 19, 2026 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant