Getting WriterAgent ready for real users #361
Replies: 5 comments 1 reply
|
Hi @Augusto-Zolet Thank you very much for all of your work and fixes. You have been very busy! Please submit them as 4 PRs, you can put B9 in the branch with the rest of the bug fixes. I'm not sure I'd do anything differently yet, but when I see the changes I'll have more ideas and will just fix it / talk to you then. |
|
@Augusto-Zolet Wow, this is an amazing set of PRs. People talk about Vini Jr. but you are the Brazilian MVP! I'll make a new GH release with these fixes and my other changes soon. Update: I made a new release. Let me know how it goes with your users. |
|
BTW, it would be fine to move to another mcp port. Which one would you recommend? Also regarding errors. For now I think it's fine if we wait for people to give us feedback. We will miss some errors, but if the product is useful enough to people, they will take the time. The Report bug does make it easy, maybe it could dig up the latest error and surrounding context in the log file by default which could be useful. Also it might be fine to have have the MCP server start LibreOffice. I wouldn't mind adding that and it would make it simpler. What do you think about that? |
|
@Augusto-Zolet Okay I requested a new release on the LO extension website (0.8.49) and a new version GitHub with all of your changes. It's an awesome release! We'll have to see what to add next. What do you think? |
|
@Augusto-Zolet It took a few days for them to review it but the new build is up there: https://extensions.libreoffice.org/en/extensions/show/99526 I've talked to LibreOffice lead developers (ESC) and they are interested in shipping LibrePy.oxt, but I don't have feedback yet so I'm working on getting the =PY() into Collabora Office also: https://forum.collaboraonline.com/t/py-numpy-inside-collabora/4844 |
Uh oh!
There was an error while loading. Please reload this page.
Hi Keith. I have been using WriterAgent daily, driving it through the MCP server on real legal documents. I also ran live experiments in a sandbox branch to try solutions before proposing them. If we align on the items below, I would split the work into a few focused branches for review (my suggested split is at the end).
A heads up on why this is a lot at once. Starting this week we will have real users on WriterAgent and I will be onboarding them myself, so I have been pushing hard to get the system ready for real use now. That is why so many fixes, changes and new features land together. Most of them are things a first time user would hit in the first hour, so I would rather have them ready than trickle them out.
1. Bug fixes
Problems that exist on master today. Every proposed fix was tested live in the sandbox and worked.
Technical note on B1. doc.findAll crashes LibreOffice (SIGABRT inside the bulk range creation) whenever the search pattern matches text that lives inside a floating drawing shape. I isolated a minimal repro (a five paragraph document with one floating shape, findAll on the shape text aborts on the very first call, while body and text box matches are fine), so this looks like an upstream LibreOffice bug. The proposed search iterates findFirst plus findNext instead, same coverage, no crash.
2. Quality of life improvements
Q5 in detail. The manual the external agent gets
On master the two agents are very unequal. The internal sidebar agent carries a rich behavior manual inside its system prompt (how to use the tools, confirm edits, and the rest), rebuilt every turn. An MCP client gets three sentences at connect (workflow, doc type filtering, a threading note) and nothing more, so an external model learns the tool behavior by trial and error, with no idea about the review modes, how to confirm an edit, navigating large documents, or concurrency. On top of that, even a longer connect message would not arrive, Claude Desktop stores the instructions text but does not read it and Claude Code truncates it (around 2 KB). So the external agent is the one flying blind, and that is what this proposal fixes.
The proposal keeps one canonical manual and delivers it in layers.
I tested this in the sandbox and the on demand flow works well (topic list, aliases, one section at a time).
One design point worth calling out.
I think the guidance should be built from reusable pieces with a single source of truth, and the base should be your original chat system prompt, not a new text. Your prompt is already partly organized as separate named pieces in the code. The proposal completes that organization. It keeps your text, updates it in place with the new behavior (the three review modes, search reach, text in shapes, a stale snapshot warning), and adds a few new pieces written in the same style. Each consumer then assembles the same pieces and adds only what belongs to its channel.
The sidebar assembly is hybrid, to keep the per turn cost down. Its ambient prompt keeps your original pieces plus the review modes piece, because that one is a safety rule the model must know before it acts (a weak model never asks first, so it must not depend on the model deciding to look something up). The reference pieces (search reach, navigation, images) stay out of the ambient prompt and the sidebar pulls them on demand through the same get_guidance tool the MCP uses. Net ambient growth stays around 2 KB instead of 3.3 KB. The MCP serves the same pieces one topic at a time through get_guidance and adds its own extras, for example the HTTP 429 concurrency rule, which the in process sidebar never needs. The Calc and Draw sidebar prompts embed the same app neutral piece (confirm edits by structured fields, re-read before targeted edits) that a Calc or Draw MCP session gets, so the single source covers every document type. Update a rule in one place and every consumer sees it, so the guidances can never drift apart.
I tested this arrangement in the sandbox. The MCP side was verified live against the running server, and the prompt assemblies are pinned by unit tests (I did not run a full sidebar chat session on the new prompt). Nothing of your prompt is thrown away or rewritten from scratch. It stays the base and gains the pieces it misses today (it currently does not explain the review modes, search reach, or text in shapes). Tests pin that every shared piece appears identically in its assemblies and that the reference pieces stay out of the ambient sidebar prompt, so a drift or a leak would fail the suite.
Q6 in detail. The default port
Proposal. Pick a less common default (a high port with no popular tool sitting on it), keep it configurable, and add a short bind retry with a clear log line when the port is busy, so a collision never looks like a silently dead server.
3. New features
F1. get_image with page render (lazy image perception)
The two modes.
F2. report_bug (agent callable feedback)
One honest point here. I want these reports to actually reach us instead of dying on the user machine, and I do not know the best way to do it. The ideal in my head is issues created automatically on the project GitHub. From what I read that would need a small relay you host (a token cannot ship inside the extension, anyone could extract and abuse it), so I want your take here. And the sidebar agent should be able to call this tool too, not only MCP clients.
F3. Plug and play connection (stdio bridge)
F4. undo and redo for the agent
F5. Table structure editing
F6. set_selection
Observations for later (no code, just findings)
Open question. A fully autonomous mode would need save, create and open
Today the agent never saves. That is on purpose. The user always owns persistence, and the new modified flag on list_open_documents lets the agent tell the user when a document has unsaved changes instead of saving it. Every workflow stays assisted. The agent prepares the work and the user reviews and saves.
I want to be explicit about what that choice costs, because it is the one thing standing between the current assisted mode and a fully unattended one. To batch process many documents with no human in the loop (open the next file, fill it from a template, save it, move to the next) the agent would need three abilities it does not have today. Saving the document (store and storeToURL for export). Creating a new document, optionally from a template. Opening an existing file for editing. Those three together are exactly what turns an assisted agent into an autonomous one, and none of them alone is enough.
I did not build them, because letting the agent write to disk on its own is a product decision more than a feature. My instinct is to keep the default assisted and put any autonomous ability behind an explicit opt in that is off by default, with opening files limited to paths the user named so a document can never instruct the agent to open something. But this is your call. Do you want WriterAgent to offer an autonomous mode at all, and if so how careful should the opt in be.
Closing and suggested branch split
Everything above came from daily use on real documents plus live experiments in a sandbox branch. That branch is a sandbox, it will not be PRed as is. If we agree on the items, I suggest deriving the work into four branches. Each one is a coherent review unit and they barely touch the same files, so they can land in any order.
B9 is test suite hygiene, independent of the four branches. It can land on its own or ride with whichever you take first.
I know this is a lot at once. I would really value your take, especially on anything you would do differently.
All reactions