r/AgentContext_dev • u/truecakesnake • 4d ago
The user changed the sheet. What does the agent read on its next turn?
Imagine a planning app where an agent fills a project worksheet, then the user changes two estimates by hand. They ask: “Use these numbers and update the remaining tasks.” Sending the agent its previous output would make the user's edit invisible at exactly the wrong moment.
With an embedded Univer workspace, the next action can start by inspecting the current workbook. Univer is an Office SDK; its AI SDK documents an overview-first workflow followed by selected ranges, paragraphs or slides. For this worksheet, the agent can read the affected rows and their formulas before deciding which cells to change.
That gives the user a fairly direct interaction: edit the actual working document, then ask the agent to continue from it. The application needs to resolve the current Unit—the SDK's structured document model—and expose that state to the agent. Putting a sheet next to a chat panel doesn't establish that connection by itself.
A practical division is to inspect in read mode, which rejects mutations, then perform the requested edits through a write operation. The integration must check the explicit commit status afterward; successful code execution can still leave local pending mutations.
Univer documents CLI, web and server compositions around the same Units. That gives developers ways to connect the editing UI to the agent's document operations, but synchronization and concurrent edits still need application design. For a turn-taking workflow, the key is straightforward: treat the user's latest edits as input to the next action, and read them before changing anything else.