@pencil-agent/nano-pencil 1.11.41 → 1.11.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -558,13 +558,9 @@ export class SessionManager {
558
558
  _persist(entry) {
559
559
  if (!this.persist || !this.sessionFile)
560
560
  return;
561
- const hasAssistant = this.fileEntries.some((e) => e.type === "message" && e.message.role === "assistant");
562
- if (!hasAssistant) {
563
- // Mark as not flushed so when assistant arrives, all entries get written
564
- this.flushed = false;
565
- return;
566
- }
567
561
  if (!this.flushed) {
562
+ // Flush the whole in-memory session on first write so the latest user turn
563
+ // survives any UI/session rebuild even before an assistant reply arrives.
568
564
  for (const e of this.fileEntries) {
569
565
  appendFileSync(this.sessionFile, `${JSON.stringify(e)}\n`);
570
566
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pencil-agent/nano-pencil",
3
- "version": "1.11.41",
3
+ "version": "1.11.42",
4
4
  "description": "CLI writing agent with read, bash, edit, write tools and session management. Supports DashScope Coding Plan. Soul enabled by default for AI personality evolution.",
5
5
  "type": "module",
6
6
  "bin": {