Repository navigation
improve: verify PostgreSQL plugin completion cancellation and cleanup - #201018
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR extends PostgreSQL completion tests through the plugin API and verifies that cancellation retains asynchronous cleanup until parent drainage finishes. Example: Cancel a completion for completion-provider/completion-model after its HTTP request starts.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR adds useful PostgreSQL lifecycle coverage, with no actionable code findings; broad CI remains pending. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe plugin LLM runtime accepts completion requests, acquires provider and credential resources through database workers, calls the HTTP transport, and retains cleanup under the caller's asynchronous work scope. flowchart TD
A[Plugin completion request] --> B[Runtime LLM owner]
B --> C[Prepared model acquisition]
C --> D[Database workers]
B --> E[HTTP provider fixture]
B --> F[Parent work scope]
F --> G[Plugin lifecycle disposal]
Technical reviewBest possible solution: Retain this focused qualification extension using the existing completion, database-worker, and lifecycle owners. Do we have a high-confidence way to reproduce the issue? No production bug is claimed; source inspection confirms the earlier suite lacked the added PostgreSQL plugin-completion cancellation scenario. Is this the best way to solve the issue? The change is appropriately scoped: it reuses the existing fixture, strengthens the exercised boundary, and preserves direct acquisition, durable health, pinning, and database-admission coverage. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 75a31ed2854c. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +92. Total +92 across 1 file. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed November 18, 2026, 1:19 AM ET / 06:19 UTC (Revision 2). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash auto-merge.
|
…openclaw#201018) * test(agents): qualify PostgreSQL plugin completion lifecycle * test(agents): isolate direct completion auth from stored profiles
…#201018) * test(agents): qualify PostgreSQL plugin completion lifecycle * test(agents): isolate direct completion auth from stored profiles (cherry picked from commit c4d8259) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit bc98401829fd0b79f3f7e9c8e80457f7c00907f1) (cherry picked from commit 057377ddd9556bdc11b8941c497fc2795e319544)
Related: #200990
Related: #200991
What Problem This Solves
The PostgreSQL qualification covered prepared completion acquisition and auth-profile bookkeeping, but did not exercise the plugin completion entry point or prove that cancellation keeps asynchronous plugin cleanup attached to its parent operation.
User Impact
No user-visible behavior changes. No SQLite schema version, DDL, migration, persisted-format, configuration, or production code changes.
Why This Change Was Made
Route the existing stored-profile failover and pinning cases through
runtime.llm.complete. Keep the configured-key acquisition/disposal cases. Add one PostgreSQL/PostgreSQL cancellation case using a real loopback provider request and a gated plugin lifecycle disposer; verify that parent drainage waits for cleanup. The eight cases reuse the existing three database-pair fixtures and still reject host-thread PostgreSQL access.This is the next bounded qualification slice from the maintainer-requested PostgreSQL audit. It does not qualify whole-Gateway shutdown or database-connection closure.
Evidence
5e677bad858c331ec7db0a547bebf0b15e4786d4, Codexgpt-6.1-sol, P0–P2: scoped-clean. Runtime success was not inferred from review.a1ed2948b23c9eaa4f361dd2a50460d570298b1d: all four PostgreSQL conformance shards, PostgreSQL 16 Gateway smoke (12/12 cases), selected typecheck/lint, changed checks, security, source contracts, boundaries, baseline ratchets, and the final CI gate. The completion shard independently executed and passed all eight completion cases. Both manual runs retain their unrelated full-tree deadcode audit failure; that audit is not counted as passing.git diff --check: passed. Production LOC delta: 0.Dependency-audit attribution
The corrected-head dependency job repeats the original head's
deadcode production report failedanddeadcode full-tree report faileddiagnostics. It reports unused exports in gbrain release helpers, message-tool discovery, session-event delivery, subagent wake scope, hook/metric types, cron UI helpers, and existing agent/session test-support modules; the unused file istest/scripts/pr-cache-deferral.node.mjs.The reported files,
config/knip.config.ts,config/knip-dynamic-consumers.mjs, andscripts/check-deadcode-exports.mtsare unchanged from frozen main5e677bad858c331ec7db0a547bebf0b15e4786d4. The complete PR changes onlysrc/agents/simple-completion-runtime.postgres.test.ts, which is absent from both reports. These existing dead-code findings remain a separate repository-maintenance follow-up; no failed audit is described as green.