Skip to content

fix: backport required 0.7.0 runtime hotfixes - #11645

Merged
bolichen97 merged 2 commits into
release/0.7.0from
fix/release-070-must-have-hotfixes
Sep 18, 2026
Merged

bolichen97 merged 2 commits into
release/0.7.0from
fix/release-070-must-have-hotfixes

Conversation

@bolichen97

@bolichen97 bolichen97 commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Bring nine already-merged must-have fixes to release/0.7.0 without importing the rest of main. Abandoned provider/browser processes retain memory, long-running dashboards retain oversized strings, an owner member pick in an empty chat can fail private-memory admission, and discovery can allocate private memory without an explicit owner choice.

Why it matters

Keep the 0.7.0 candidate usable without changing existing memory bindings or weakening cleanup ownership checks. This is a bounded release backport, not a claim that every leak is cured. The nine sources are collected in this same PR as authorized. Nothing here merges, tags, publishes, deploys, or changes a live installation.

What changed (motivation → approach → change)

Area Release behavior
ACP, session_pid.py and platform_compat.py Record identity-verified runtime descendants after initialization and session create/load. Reap verified provider trees, recover a reaped leader's group only through a recorded witness, and recognize macOS zombie roots.
session.py, session_cleanup.py and session_scope_reap.py Reconcile abandoned Linux scopes on cleanup ticks, off the event loop. Require a complete tracking snapshot, this install's slice, no active/tracked member, positive runtime identity, full ownership attribution, and age/lifecycle proof. Preserve intentional detached workloads.
Browser cleanup Ignore unreadable unrelated Linux processes only with stable different-cgroup proof; retain conservative owner checks.
Dashboard and history.py An explicit owner selection in an empty plain chat can write the private-member grant; a turn only confirms a grant. Discovery registers new agents on Global V1. Existing Global/named V1 and private V2 bindings stay unchanged; explicit creation/opt-in still provisions V2.
Frontend store, hooks and pierre Bound live tool input/output, hidden-window buffers and diff-cache size; remove unread reasoning duplicates.
Frontend pages, types and i18n Preserve the activity view, describe tool rows accurately, and translate the truncation marker.
Tests, capture, scripts and docs Carry source regressions and rendering evidence; add release-specific binding-preservation and off-loop cleanup-hook tests.

Release base: c359f83. Verified main snapshot: 9628c8c. All nine source commits are ancestors of that snapshot.

Source PR Actual source commit Application / essential adaptation
#11309 187f067 Provider-tree cleanup with its coupled neutral identities, off-loop session reset and tests. The existing first commit removes only the graduated reset-sessions test from the .github Black baseline.
#11491 5619823 Required macOS companion to #11309.
#10811 85847f0 Browser cleanup with stable different-cgroup proof.
#10985 9e37981 Frontend memory bounds; preserve release's tool-event schema instead of importing main-only tool fields.
#11376 1ce78fb Owner-grant backport; retain source-added authorization coverage without unrelated main-only test helpers.
#11565 fd11736 Runtime descendant registration. Merge imports while retaining AcpToolGateUnroutable. Map the source's _finish_create_session test/spec references to release's create_session. Omit only the unrelated old-test reformat and its baseline deletion.
#11456 2eb673c Recorded-descendant group recovery; carry source cancellation/publication and durable-workflow regression tests.
#11630 e66570d FIRST-PARENT delta only. New discovery stays V1; existing stores are preserved. The source-only fixture edits to test_chat_agent_selection.py are not imported because that main-only file is absent on release; discovery, explicit opt-in, publication and release binding-preservation tests cover this change.
#11594 263075d Linux abandoned-scope reaper, its cleanup hook, ownership helpers, spawn-audit entries and full source regression suite. All required sandbox/platform helpers already exist on release.

No extra dependency commit or package is needed. No wholesale main merge, optional #11367/#10804, #11577 or #11607, apps-permission expansion, SSH forwarding, version bump or changelog edit. No V1-to-V2 migration or private-session downgrade. Scope survivors without a provable runtime anchor remain an explicit fail-closed residual.

Changed surfaces include acp/client.py and acp/runtime.py; dashboard/chat_handlers.py, dashboard/chat_persistence.py, dashboard/chat_runner.py and dashboard/handlers; website/capture, website/scripts, website/src/hooks, website/src/i18n, website/src/pages, website/src/pierre, website/src/store, website/src/test and website/src/types. No workflow, permission, check/protection configuration or trigger changes. The second commit makes no .github changes.

Tests

Final reviewed commit: 698a523. It is the one new commit on top of 94506a1; total PR history is two commits.

  • Current-tree native builds passed: npm run build (TypeScript + Vite) and python setup.py build (setuptools).
  • First targeted backport run: 394 passed, 1 skipped. Final adaptation-only run: 86 passed, including Global/named V1/V2 preservation, explicit opt-in, cleanup-hook active-PID fencing and off-loop execution.
  • Final 14-file targeted run: 1,544 passed, 1 skipped, 1 failed. The failure is the unchanged test_session.py::TestCleanupLoopResilience::test_cleanup_loop_continues_after_expire_idle_crash reaching its 5-second deadline in the existing orphan-MCP hook. Running the whole test_session.py file on an untouched c359f83 worktree reproduces the same failure: 312 passed, 1 failed on BOTH base and current tree. The exact node passes alone on both. This is recorded as a pre-existing order-sensitive test limitation, not a clean-suite claim; no timeout or assertion was relaxed.
  • The added named-V1 fixture initially lacked its actual directory. Creating that fixture directory made all 86 adaptation tests pass without changing product behavior.
  • Current-tree static/doc gates passed (19): scoped isort and flake8, mypy, Black baseline gate, subprocess encoding, comment history, agent SDK boundary, sync-I/O, lockdown-before-publish, brand, harness parity, feature map, loop locks, builtin skill scope, testpaths, changelog history, focus cue, memory-store seam and docs lint. Diff-based checks use the release base; tests run serially with isolated scratch/data paths and absolute PYTHONPATH.
  • Historical evidence for the unchanged first-commit frontend: related frontend batches had 23,172 passing test executions; Electron had 1,901 passed, 1 skipped. First-commit focused backend validation had 1,961 passed, 25 skipped. The earlier broad-run environment failures reproduced on release and passed after temporary-directory and child-import isolation. Those broad suites were NOT rerun for this backend-only increment.
  • Two independent read-only local reviews used the extracted release-base GPT and Opus CI contracts against the COMPLETE final working-tree diff, not only the old committed head. Both returned no findings. Requested model pins were used; served-model identity was not independently verified. The subsequently committed diff matches the reviewed patch SHA256: 9092cb93082da78e59917b0ce2cd13f0a09bf9799fe7b83b4f89f408592e701b.
  • Profile limitations remain explicit: its default base is main, so release-relative checks name release/0.7.0. The ACP-frame-host-data script is absent on release and was not imported. The unrelated CloudFormation lint entry was not run; no deployment template changed.

Manual verification

The source tool-output capture was run on this release worktree at 94506a1 in light and dark themes and its rendered images inspected. A 144,069-character result renders 60,044 characters; one marker reports 84,080 removed characters and preserves whole head/tail lines. Both themes passed all ten assertions without page errors. The new commit has no frontend delta, so these remain evidence for identical UI code, not newly captured images of a different head.

Process tests use fixture-owned processes and process tables. Native macOS/Windows execution and long-duration leak trends were not exercised on this Linux host. POSIX retains the source-documented read-to-signal interval; no new atomic-PID-signaling guarantee is claimed. No live cleanup, config write or deployment was performed. Existing marker wording and the absence of an inline full-output action remain unchanged; the advisory UX concerns are answered in the PR thread rather than expanded into a new UI feature.

Screenshots / video

Unchanged release UI captured at 94506a1, with assertion evidence.

Tool output, dark
Tool output, light

Full release-target CI is UNAVAILABLE: the release-base CI, Fast Gate and Build workflows accept only main for pull_request/push and have no workflow_dispatch entry. Review/portability/screenshot/scope/readiness workflows are not the full build/test matrix. Per maintainer direction, no workflow, branch filter, PR target, permission or protection is changed to obtain green. Native macOS/Windows and full release-target build/test results remain a pre-merge validation gap; local results do not replace them.

Related Issues

no linked issue: this bounded release backport deliberately closes no original leak issue.

Pattern harvest

Rule candidate: review-prompt
Pattern: backport process-identity producers and consumers together; persist only identities captured under ownership confirmation; keep discovery separate from private-memory consent.

Checklist

  • At most two commits, with a Conventional Commits title
  • Source regressions and release-adaptation tests carried; builds and static gates passed
  • Self-review and two independent read-only reviews completed on the final diff
  • Source documentation carried and release API references adapted
  • No secrets, credentials, or internal references introduced
  • Full targeted suite: one pre-existing order-sensitive test failure reproduced on untouched release
  • Native macOS/Windows and full release-target CI validation still unavailable

Backport merged fixes #10985, #10811, #11376, #11309 and #11491.\nKeep release event fields and preserve private memory isolation.\nLeave unmerged must-haves and adjacent optional changes out.
@bolichen97
bolichen97 requested review from a team and cixuuz and removed request for a team September 18, 2026 02:08
@bolichen97

Copy link
Copy Markdown
Contributor Author

Intent: Backport the already-merged MUST-HAVE process cleanup, frontend memory bounds, and explicit private-member selection fixes to release/0.7.0 in one PR. Collect the currently pending must-haves into this SAME PR only after their source PRs merge to main, then rerun release-relative validation.
Not a goal: Merge all of main, include optional adjacent fixes or new features, migrate V1 discovery to V2, downgrade private sessions, close the original leak issue, merge any PR, cut a tag, publish a release, change live configuration, or enable auto-merge.

@bolichen97

Copy link
Copy Markdown
Contributor Author

Release-worktree rendered evidence for head 94506a1. Both themes passed all ten capture assertions: raw=144069, rendered=60044, one marker with count=84080, whole head/tail lines preserved, elided sentinel absent, no page errors. These captures are from this backport, unlike the explicitly attributed source-PR images in the description.

Release backport tool output, dark theme

Release backport tool output, light theme

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 18, 2026
@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of 698a5239dff254b6101a07a1346a7ee35cefb44c and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 698a523

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 698a5239dff254b6101a07a1346a7ee35cefb44c: <one-sentence reason>

@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — 🟡 CONCERNS

Design-level review of 698a5239dff254b6101a07a1346a7ee35cefb44c — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: CONCERNS

Nine hand-adapted backports — including a brand-new 734-line scope reaper — reach release/0.7.0 with no release-target CI and no native macOS/Windows execution.

Watch

  • The riskiest cargo is not the cherry-picks but the adaptations (e.g. _finish_create_session → create_session mapping, omitted main-only fixtures, release tool-event schema in fix(chat): bound large-string retention in the live chat state #10985): main's CI validated the sources, and the description concedes "Full release-target CI is UNAVAILABLE… local results do not replace them" — so a regression in the adaptation delta lands in the 0.7.0 tag with only local targeted runs and two local model reviews between it and release. The macOS zombie-root arm (fix(session): reap the provider root on macOS once it is a zombie #11491, test_darwin_zombie_reap.py) additionally shipped without any native Darwin execution.
    Clears when: the full build/test matrix runs against this head on a CI-visible ref (or native macOS/Windows runs are recorded) before the 0.7.0 tag is cut.

Suggestions

[DESIGN-REVIEWED] 698a523

@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Fable 5) — 🟡 CONCERNS

UX-level review of 698a5239dff254b6101a07a1346a7ee35cefb44c — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: CONCERNS

The truncation marker's only remedy is one the cold reader feared to use — "full output on reload" names a recovery it doesn't offer.

Watch

  • The new string …({{count}} characters truncated — full output on reload) (en.manual.json, rendered by clampToolOutput in chatSlice.ts) states its remedy as a fact with no affordance. The blind reader understood the truncation but said: "I would not dare touch it… 'reload' sounds like it might refresh the whole page and lose my place" — so the one user who needs the elided middle avoids the only path to it, every time a >64k output occurs (routine in verbose test runs). Smallest fix within this PR: reword to an explicit, fear-free instruction, e.g. "…({{count}} characters hidden — refresh the page to see the full output)"; the inline fetch action can stay the deferred follow-up the PR thread already records.

[UX-REVIEWED] 698a523

@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — 🟡 CONCERNS

Premise-level review of 698a5239dff254b6101a07a1346a7ee35cefb44c — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: CONCERNS

Item 7 flips what every newly discovered agent gets by default — private V2 to Global V1 — on the authority of a source-PR link this run cannot verify.

Not justified as shipped

  • Item 7 — inherited (product-shape default change): discovery sync's default memory binding flips from private-V2 allocation to Global V1, reversing pins this diff rewrites (spec: "New members receive V2 automatically"; test_agent_sync_prune.py now asserts store == "default"). The reversal is declared, and the named harm (private allocation without owner consent) sits on a real boundary — but the only recorded decision offered is "[fix: keep discovered agents on memory v1 until owner opt-in #11630] … New discovery stays V1", a merged-on-main claim I could not fetch, and the base RFC list names nothing covering member-memory shape.
    Clears when: a maintainer confirms PR fix: keep discovered agents on memory v1 until owner opt-in #11630 (commit e66570d) is merged on main covering exactly this shape, or records /ai-review override first-principles 698a5239dff254b6101a07a1346a7ee35cefb44c: <decision>.

What this change ships

Inventory (10 items) — 9 justified

Intent: FIX — backport nine already-merged runtime/memory hotfixes from main onto release/0.7.0 without importing the rest of main.

  1. Abandoned provider process trees are now group-signalled and reaped at teardown, identity-verified per pid — justified
  2. Runtime records verified descendant PIDs after init and every session create/load, so sweeps can find survivors — justified
  3. macOS zombie provider roots are recognized, so a reaped leader's group is recovered instead of leaking — justified
  4. Linux abandoned agent cgroup scopes are reclaimed on cleanup ticks behind four conjunctive ownership gates — justified
  5. Browser-daemon sweep ignores unreadable unrelated processes only with stable different-cgroup proof — justified
  6. Picking a member in an empty plain chat writes the private-memory grant; a turn only confirms one — justified
  7. Discovery sync registers new agents on Global V1 instead of allocating private V2 — inherited (product-shape default; see above)
  8. Live tool input/output, hidden-window stream buffers and the diff cache are size-bounded, with a translated truncation marker — justified
  9. Reasoning text is no longer duplicated into the never-rendered activity tool log — justified
  10. Session reset's force-kill runs off the event loop with a daemon-thread fallback — justified

[FIRST-PRINCIPLES-REVIEWED] 698a523

@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Opus 4.8 Review — ✅ no blocking findings

Reviewed 698a5239dff254b6101a07a1346a7ee35cefb44c — this comment is updated in place on each push.

Review details

Both candidates fail the falsification bar.

Candidate 1 — the "leak" requires a timing race in the degraded fallback path (systemctl stop unavailable/failing) where the marked ancestors (kiro-cli, the playwright node daemon) all die during the 3s SIGTERM grace while the env-cleared leaf both received SIGTERM in the first pass and ignores it through the grace. The ownership recompute against the shrunken remaining is code-certain, but whether ancestors die before the unmarked leaf survives is exactly the "might" the bar forbids — and the leaf reparenting and out-living its marked chain within 3s is unverifiable (the candidate itself concedes it "could not verify chrome-headless's SIGTERM timing"). The freshness-based re-verification is a deliberate design choice (docstring L40-42: never signal a recycled PID); the proposed fix of threading the initial owned set would reintroduce that documented recycled-PID hazard. Below 80.

Candidate 2 — requires a transient non-ENOENT OSError (EACCES/EINTR/ENODEV) on a kernel virtual file (cgroup.procs) that Python already retries for EINTR, while live members persist. The candidate rates itself "low" and states the impact is confined to reporting/accounting — not a wrong signal, crash, or data loss. Rare trigger, non-blocking class, below 80.

No self-originated finding survived falsification to the same bar.

No findings.

[OPUS-REVIEWED] 698a523

Verdict parsed from the review's SHA-scoped output markers for commit 698a5239dff254b6101a07a1346a7ee35cefb44c.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 698a5239dff254b6101a07a1346a7ee35cefb44c: <one-sentence reason>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 18, 2026
Backport #11565, #11456, #11630 and #11594 onto the existing release
hotfix branch. Track runtime descendants, recover witnessed process
groups, preserve V1 discovery defaults, and reap abandoned Linux scopes.

Use the first-parent delta of e66570d; retain release session APIs,
existing memory bindings and conservative cleanup ownership checks.
Carry source regressions and add release-specific binding and hook tests.
No workflow, dependency, version or live configuration changes.
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 18, 2026
@bolichen97

Copy link
Copy Markdown
Contributor Author

span=99fb501fe250

Disposition: fixed. Implemented in 698a5239dff2 from merged #11565, with #11456 and #11594 completing the authorized cleanup set. AcpRuntime snapshots descendants after initialize and session create/load, persists caller-captured identity tokens under root/second-walk confirmation, and retains surviving descendants at teardown. Release uses create_session rather than importing main's split helper.
Verification / boundary: The 394-pass source-focused run and 86-pass adaptation run exercise tracking, cancellation guards, PID reuse, witnessed group recovery, scope ownership and off-loop active-PID fencing. Both independent local reviews cleared the complete final patch. The separate old cleanup-loop timeout reproduces on untouched release; native macOS/Windows CI remains unavailable, not waived.

@bolichen97

Copy link
Copy Markdown
Contributor Author

span=c38293b0418e

Disposition: needs-a-decision. The native-platform validation gap is real and remains open BEFORE MERGE. CI, Fast Gate and Build only target main and expose no manual dispatch on this release base. Maintainer direction explicitly forbids changing CI configuration to get green, so this update neither changes those filters nor substitutes local Linux results for macOS/Windows execution. The tool-event schema adaptation cited in the finding belongs to the frontend; it is not a rewrite of the Darwin process helpers.
Verification / boundary: Release maintainers must decide how approved native/cross-platform evidence will be obtained before merging 698a5239dff2. Current evidence: TypeScript/Vite and setuptools builds passed, 19 static/docs gates passed, final 14-file run had 1,544 passes/1 skip and one pre-existing order-sensitive failure reproduced on the untouched base. This disposition does not clear the missing CI matrix or authorize merge.

@bolichen97

Copy link
Copy Markdown
Contributor Author

span=314ce35fc5a6

Disposition: rebutted. The proposed split conflicts with the explicit maintainer-approved intent to collect these four merged must-haves in this SAME PR. All nine sources are now in the manifest; there are no pending source backports in this bounded set. Evidence is refreshed rather than carried forward as if an old head had been retested.
Verification / boundary: The final 698a5239dff2 diff is byte-identical to the complete patch both independent reviewers inspected (SHA256 9092cb93082da78e59917b0ce2cd13f0a09bf9799fe7b83b4f89f408592e701b). Native builds and targeted/static validation were rerun. Existing screenshots remain explicitly attributed to 94506a1, and git diff from that head confirms zero frontend changes; they demonstrate identical UI code, not a fabricated new capture. Full release CI is still disclosed as unavailable.

@bolichen97

Copy link
Copy Markdown
Contributor Author

span=e9815ad6d5e7

Disposition: rebutted. A workflow_dispatch or release/* filter would enable a different CI execution surface, but the maintainer explicitly chose no CI/workflow/permission/protection changes for this task and no new PR. That policy is preserved, rather than bypassed to manufacture green.
Verification / boundary: 698a5239dff2 changes no .github file. The full PR only retains the already-published first commit's one-line Black-baseline graduation; workflow files remain identical to release. The description identifies the missing full matrix as an unresolved pre-merge validation gap. No dispatch, override, merge or release action was taken.

@bolichen97

Copy link
Copy Markdown
Contributor Author

span=50bbc427f21c

Disposition: rebutted. The copy ambiguity is acknowledged; this disposition rejects broadening this bounded source backport into a locale-copy revision, not the blind reader's observation. The existing merged #10985 wording is preserved across its locales. The hotfix changes retained live strings, not transcript deletion: ToolCallLine has a persisted-message metadata fallback for input/output, and the clamp lives in the client store. No claim is made that wording was improved or that an in-flight result is durably saved.
Verification / boundary: The PR body explicitly records the unchanged wording as an advisory UX concern. Its existing light/dark captures verify marker count and whole-line rendering; they do not claim a new reload interaction. 698a5239dff2 has no frontend delta. Native builds passed; additional copy changes are not necessary to deliver the four specifically authorized runtime/discovery source fixes.

@bolichen97

Copy link
Copy Markdown
Contributor Author

span=413cf50ff450

Disposition: rebutted. A Show full output action is not an existing cheap renderer hook on this release. ToolCallLine selects live tool-log output or message metadata and passes the string to ToolDetails; the marker is plain text inside clampToolOutput. There is no full-output fetch callback to wire up. Adding one would require a new interaction/data-fetch contract rather than a faithful source backport, and retaining a second unbounded live string would defeat this fix's memory bound.
Verification / boundary: The existing output rendering and source wording are deliberately unchanged in 698a5239dff2. The retained screenshots and capture assertions cover the actual clamped-output surface; no screenshot or test is presented as evidence of a nonexistent full-output button. No additional UI feature or untracked follow-up is being promised.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Sep 18, 2026
@bolichen97
bolichen97 merged commit ef15279 into release/0.7.0 Sep 18, 2026
23 of 30 checks passed
@bolichen97
bolichen97 deleted the fix/release-070-must-have-hotfixes branch September 18, 2026 05:04
@github-actions github-actions Bot removed the readiness: checking Automated validation is still running label Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant