Skip to content

fix(transcripts): report auto-start shutdown warnings - #131381

Merged
steipete merged 1 commit into
mainfrom
steipete/pensive-nash-6b1660
Aug 28, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/pensive-nash-6b1660

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Closes #131375 (transcript auto-start shutdown warning loss).

What Problem This Solves

Fixes an issue where operators using configured transcript auto-start captures would receive no warning when shutdown saved meeting notes but failed to export their files. The same unattended stop path also discarded fulfilled provider-stop warnings.

Why This Change Was Made

Refactor the existing auto-start stop loop into one result/error reporting flow. Consume the existing structured warning fields rather than discarding fulfilled tool results; reuse the existing logger with redacted, escaped, bounded diagnostic values. Export warnings distinguish a saved summary from a failed artifact, label the intended path, and explain how to retry after correcting the destination.

Canonical summary persistence remains successful, healthy sibling captures still finish, and intentional skipped ownership outcomes remain quiet. The manual tool result, lifecycle/stop tokens, storage/schema, transcript ID admission, fs-safe classification, provider cleanup/retry policy, and Gateway shutdown ordering are unchanged. No new configuration, dependency, or public API is introduced.

User Impact

Operators now get actionable warnings in the normal Gateway logging surface instead of discovering missing exported summaries later. Notes remain durable when export fails, and warning logs do not include transcript or summary payloads. The transcripts CLI documentation now explains this distinction and explicit export recovery.

Evidence

AI-assisted implementation with direct owner/caller/sibling inspection and an independent Codex autoreview; no accepted/actionable findings from the blocking review pass.

  • Before/after regression: the new seven-case auto-start suite failed on original source for export-only, provider-only, and combined warning loss (zero warnings), plus the existing unbounded thrown-error diagnostic. The exact suite passes after the repair.
  • Original independent reproduction, unchanged: seven scenarios now pass the expected-warning invariant using real service start/status/utterance/stop ordering, a native post-start ENOTDIR export obstruction, SQLite close/reopen, and the actual subsystem file logger. Summary durability, unchanged obstruction, sibling continuation, repeated stop, manual result fields, and warning delivery were verified. All task-owned state and database handles were cleaned up.
  • Focused owner/sibling tests: 81 tests passed across transcript tool/auto-start/account ownership/import, transcript store, transcript CLI, and meeting bridge suites.
  • Formatting: targeted oxfmt and git diff --check passed.
  • Changed gate: full check-changed run passed without skipped guards: production types, all 14 core test type graphs, changed-file lint/format, unused-export scans, plugin boundaries, schema/storage guards, runtime-loader checks, and import cycles. Initial test-only type/lint compatibility errors were repaired using existing helpers and supported assertions, without compiler, guard, dependency, or baseline changes. The final path-quoting assertion and documentation clarification were separately rechecked with the focused seven-case suite, typed lint, formatting, and diff checks.
  • Build: pnpm build passed all phases, including CLI bootstrap, plugin SDK exports, and Control UI sidecar/budget checks. No ineffective dynamic import warning was emitted; runtime source was unchanged by subsequent test/docs refinements.

Focused command:

node scripts/run-vitest.mjs src/agents/tools/transcripts-tool.auto-start.test.ts src/agents/tools/transcripts-tool.test.ts src/agents/tools/transcripts-tool.import.test.ts src/agents/tools/transcripts-tool.account-ownership.test.ts src/transcripts/store.test.ts src/cli/program/register.transcripts.test.ts src/meeting-bot/transcripts-bridge.test.ts

Observed transcript warning progression (isolated paths abbreviated):

Before: auto-export -> summary persisted; export absent; warnings=[]
After:  transcripts autoStart session="auto-export": summary saved; export failed intendedSummaryPath="<isolated-state>/.../summary.md": "Error: ENOTDIR: not a directory, scandir ...". Correct the export destination, then run openclaw transcripts path <session> or openclaw transcripts show <session>.
After:  transcripts autoStart session="provider-warning": provider stop failed: "fixture stop warning". Check the provider capture status and connection.

Production LOC: +36/-13 (net +23). Tests: +229/-0. Docs: +12/-4 (net +8). The old catch-only reporting path is replaced rather than retained. Production growth implements the missing two-stage lifecycle warning reporting and bounded/redacted rendering; no unrelated deletion was used to reduce the count.

Proof boundary: the real in-process lifecycle/store/log sink was exercised with a fixture external provider; no real Discord/meeting connection, live Gateway service, or UI was used. No external provider API changed. The existing rejected-provider-stop cleanup-retention behavior and aggregate Gateway shutdown warning summary remain separate follow-ups, not changes in this PR.

Release-note context: transcript auto-start shutdown now reports failed summary exports and provider-stop warnings while preserving saved notes and continuing sibling cleanup.

Configured captures now report failed summary exports and provider-stop warnings while preserving saved notes and sibling cleanup.

Refs #131375.
@steipete steipete self-assigned this Aug 28, 2026
@clawsweeper

clawsweeper Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling size: M maintainer Maintainer-authored PR labels Aug 28, 2026
@steipete
steipete marked this pull request as ready for review August 28, 2026 01:42
@steipete

steipete commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Land-ready verification for 8b0ccce561016e93aa90cf50ec28bf6715bb7acf.

The root cause is the auto-start lifecycle consumer discarding fulfilled stop results. The repair replaces that catch-only path with one diagnostic reporting flow for export warnings, provider-stop warnings, and rejections. Saved notes remain successful, lifecycle ownership/skips and sibling cleanup are preserved, and logs contain bounded/redacted diagnostics rather than transcript or summary payloads. Best-fix verdict: the lifecycle owner is the correct boundary; neither storage-level logging nor converting export degradation into rejection would preserve these semantics.

Observed before/after: after normal capture and a persisted utterance, a real file obstruction at the export-directory path causes native ENOTDIR. Before the repair, auto-stop emitted zero warnings; afterward its warning reached the real subsystem file log. The canonical summary survives SQLite close/reopen, the obstruction is untouched, and a healthy sibling still exports. Provider-only and combined warnings, manual tool controls, repeated stops, and the thrown-provider control were also exercised. The original seven-scenario expected-warning probe was rerun unchanged and passed.

Completed validation:

  • Regression-first suite: 4 failed / 3 passed before the production change; the final seven-case suite passes. Three original failures were missing export/provider/combined warnings; the fourth exposed the old unbounded thrown-error diagnostic.
  • Focused owner/sibling run: 81 tests passed across seven files. The final seven-case suite passed again after test-library/lint compatibility corrections and JSON-quoted path portability coverage; these reruns are not added to the unique-test count.
  • Full changed-file gate passed without skipped or weakened guards: core types, all 14 core test graphs, typed lint, formatting, unused exports, plugin/storage/schema boundaries, runtime loaders, and import cycles. Final test/docs refinements also passed targeted tests/lint/format and diff checks.
  • Full build passed all phases, including CLI bootstrap imports, public SDK exports, and Control UI sidecar/budget guards. No ineffective dynamic import warning was emitted.
  • Fresh independent Codex autoreview of the final diff reported no accepted/actionable findings in its blocking review scope. Native review artifacts were independently prepared and validated, with no findings.
  • Exact-head CI run 33133687338, attempt 1 completed successfully on this head; required openclaw/ci-gate is SUCCESS. The PR is mergeable.

Exact focused commands:

node scripts/run-vitest.mjs src/agents/tools/transcripts-tool.auto-start.test.ts src/agents/tools/transcripts-tool.test.ts src/agents/tools/transcripts-tool.import.test.ts src/agents/tools/transcripts-tool.account-ownership.test.ts src/transcripts/store.test.ts src/cli/program/register.transcripts.test.ts src/meeting-bot/transcripts-bridge.test.ts
node scripts/run-vitest.mjs src/agents/tools/transcripts-tool.auto-start.test.ts
node scripts/check-changed.mjs -- src/agents/tools/transcripts-tool.ts src/agents/tools/transcripts-tool.auto-start.test.ts docs/cli/transcripts.md
node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/agents/tools/transcripts-tool.auto-start.test.ts src/agents/tools/transcripts-tool.ts
node_modules/.bin/oxfmt --check src/agents/tools/transcripts-tool.ts src/agents/tools/transcripts-tool.auto-start.test.ts docs/cli/transcripts.md
git diff --check
pnpm build

Production LOC: +36/-13 (net +23); tests: +229/-0; docs: +12/-4 (net +8). The production growth implements the two missing fulfilled-warning outcomes and shared safe diagnostic rendering; no generic framework or parallel lifecycle was introduced.

Proof limits: the real in-process lifecycle/store/log boundary was exercised with a fixture external provider, not a live Discord/meeting connection, Gateway service, UI, or Windows execution. No external provider API changed. The completed ClawSweeper review has now been checked; its before-merge items are addressed below. Existing thrown-provider retry ownership and the aggregate Gateway shutdown warning summary remain separate follow-ups. Storage/schema, transcript ID admission, fs-safe classification, dependencies, and live operator gateways are unchanged.

Completed ClawSweeper follow-through: The exact-head review reports no actionable correctness or security findings. There is no separate Rank-up moves list; both before-merge items are resolved here. The +23 production lines are accepted for the two existing structured warning classes and shared safe diagnostic rendering. formatAutoStopDiagnostic remains the single dynamic-value formatter within one shutdown reporting loop; the old catch-only path is removed, with no parallel lifecycle or warning framework. Ordinary maintainer review and explicit landing approval are complete, and native prepare passed using the successful exact-head hosted CI run; the source/prepared head is unchanged.

The review's stored-data detector does not describe a persistence change in this diff: only diagnostic imports/formatting and the auto-start result consumer changed in production. Canonical writes, schema, stored shapes, manual result fields, and export ownership remain unchanged, so no migration is required or introduced. Its verification runner reported a failed output expectation because the command did not print the exact describe-title string transcripts auto-start stop reporting; the captured command itself exited successfully and reports all seven tests passing. That is an output-expectation failure, not a failing regression suite or live Gateway result. No assertions, guards, or runtime behavior were weakened to address it.

@clawsweeper

clawsweeper Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 27, 2026, 9:51 PM ET / August 28, 2026, 01:51 UTC.

ClawSweeper review

What this changes

The PR logs safe, actionable warnings when configured transcript auto-start shutdown preserves a summary but cannot export it, or when a provider returns a stop warning.

Regression provenance

Possible regression — probable (reproduction; reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this focused member-authored repair open for ordinary maintainer review. The introduced result-handling path restores warnings that current main discards, and no blocking correctness defect was found.

Priority: P2
Reviewed head: 8b0ccce561016e93aa90cf50ec28bf6715bb7acf

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is focused, matches the existing stop-result contract, and is backed by a meaningful owner-boundary regression suite.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its body nevertheless records source-level lifecycle, filesystem, SQLite, and logger evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This MEMBER-authored PR is exempt from the external-contributor proof gate; its body nevertheless records source-level lifecycle, filesystem, SQLite, and logger evidence.
Evidence reviewed 7 items Current-main failure path: Current main only catches rejected stop operations; it never reads fulfilled tool details, so fulfilled export and provider warnings are discarded.
Introduced repair: The PR reads structured stop details, emits export/provider diagnostics, and sanitizes, redacts, bounds, and JSON-quotes dynamic log values.
Owner result contract: The stop owner records provider stop failures and returns provider/export diagnostics after durable summary persistence, which makes the lifecycle service the correct consumer boundary.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs src/agents/tools/transcripts-tool.auto-start.test.ts

Result: FAIL (failed) — step 1 expect_output transcripts auto-start stop reporting: terminal command exited successfully before expected output appeared: "transcripts auto-start stop reporting"

[failure]
terminal command exited successfully before expected output appeared: "transcripts auto-start stop reporting"

[command 1 combined output]
[test] starting test/vitest/vitest.agents-tools.config.ts

 RUN  v4.1.11 /tmp/clawsweeper-live-proof-131381-QnOMPy/target

 ✓  agents-tools  src/agents/tools/transcripts-tool.auto-start.test.ts (7 tests) 2833ms
     ✓ 'export failure' preserves state and finishes siblings  596ms
     ✓ 'fulfilled provider warning' preserves state and finishes siblings  440ms
     ✓ 'both warnings' preserves state and finishes siblings  362ms
     ✓ 'healthy stop' preserves state and finishes siblings  375ms
     ✓ 'thrown provider error' preserves state and finishes siblings  358ms
     ✓ 'manual export failure then skipped au…' preserves state and finishes siblings  347ms
     ✓ 'manual both warnings then skipped aut…' preserves state and finishes siblings  350ms

 Test Files  1 passed (1)
      Tests  7 passed (7)
   Start at  01:52:07
   Duration  12.64s (transform 7.76s, setup 1.06s, import 8.39s, tests 2.83s, environment 0ms)

[test] passed 1 Vitest shard in 19.16s

Assertions:

  • FAIL expect_output: transcripts auto-start stop reporting

How this fits together

Configured transcript auto-start creates capture sessions during Gateway startup and stops them during Gateway shutdown. Stopping persists the canonical summary in SQLite, optionally exports files, and reports recoverable problems through the Gateway logger.

flowchart LR
  A[Configured capture] --> B[Auto-start lifecycle]
  B --> C[Stop active session]
  C --> D[Persist summary in SQLite]
  C --> E[Provider stop result]
  D --> F[Optional artifact export]
  E --> G[Safe operator warning]
  F --> G
Loading

Before merge

  • Resolve merge risk (P1) - Production code grows by 23 net lines for fulfilled-result extraction and safe diagnostic rendering; the shared formatter should remain the sole logging path rather than accumulating parallel warning handling.
  • Complete next step (P2) - No repair job is needed: this member-authored, maintainer-labeled PR has no actionable review finding and should proceed through normal exact-head CI and maintainer review.
Agent review details

Security

None.

PR surface

Source +23, Tests +229, Docs +8. Total +260 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 36 13 +23
Tests 1 229 0 +229
Docs 1 12 4 +8
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 277 17 +260

Review metrics

Metric Value Why it matters
Production versus test delta production +23 net, tests +229, docs +8 net The production growth is confined to structured warning extraction and safe formatting; the larger test addition exercises the shutdown owner boundary.

Stored data model

Persistent data-model change detected: serialized state: src/agents/tools/transcripts-tool.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Merge the single lifecycle reporting flow after exact-head checks complete; its positive production delta is justified by preserving two structured warning classes while using existing redaction and terminal-safety helpers.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Merge the single lifecycle reporting flow after exact-head checks complete; its positive production delta is justified by preserving two structured warning classes while using existing redaction and terminal-safety helpers.

Do we have a high-confidence way to reproduce the issue?

Yes, at source level: current main's catch-only loop drops fulfilled result details, and the submitted regression fixture exercises the real service, SQLite store, filesystem export, and logger boundary.

Is this the best way to solve the issue?

Yes. Consuming the existing structured result at the auto-start lifecycle owner avoids changing persistence, provider contracts, or the manual tool path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against b82dae06c9bb.

Labels

Label changes:

  • add P2: This fixes operator visibility for configured transcript shutdown failures without evidence of data loss or an availability outage.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.

Label justifications:

  • P2: This fixes operator visibility for configured transcript shutdown failures without evidence of data loss or an availability outage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.

Evidence

What I checked:

Likely related people:

  • steipete: Current main's auto-start shutdown loop and the proposed reporting repair are both attributed to this contributor in local history. (role: current feature owner; confidence: high; commits: 4f47de6d0de2, 8b0ccce56101; files: src/agents/tools/transcripts-tool.ts, src/agents/tools/transcripts-tool.auto-start.test.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 8cbda43 into main Aug 28, 2026
304 checks passed
@steipete
steipete deleted the steipete/pensive-nash-6b1660 branch August 28, 2026 02:10
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 28, 2026
Configured captures now report failed summary exports and provider-stop warnings while preserving saved notes and sibling cleanup.

Refs openclaw#131375.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation maintainer Maintainer-authored PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Transcript auto-start shutdown silently drops export and provider warnings

1 participant