Skip to content

fix: keep discovered agents on memory v1 until owner opt-in - #11630

Merged
bolichen97 merged 1 commit into
mainfrom
fix/agent-sync-v1-default
Sep 18, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/agent-sync-v1-default

Conversation

@bolichen97

@bolichen97 bolichen97 commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Ordinary agent discovery creates private Memory V2 without an owner choosing it. Opening chat can therefore opt an installed agent into private memory, or fail when private execution is unavailable.

Why it matters

Discovering an installed agent should not change its memory model. Private memory must be an explicit choice, not a side effect of opening chat.

What changed (motivation → approach → change)

Flow Before After
Discover an ordinary agent 🟥 Allocate V2 🟨 Keep Global V1
Discover with private creation paused 🟥 Refuse sync 🟨 Register V1
Explicit Create private memory 🟦 Allocate V2 🟦 Allocate V2
Existing member binding 🟦 Preserve 🟦 Preserve

🟩 added · 🟨 changed · 🟥 removed · 🟦 unchanged

Discovery in dashboard/handlers/agents.py now only registers the agent. It no longer allocates a private store, publishes store ownership, or cleans up a newly allocated store. The existing explicit creation and opt-in paths retain all private-memory checks. Existing bindings and package-prune archival remain unchanged.

Tests cover discovery under unsupported private execution and the provisioning pause, repeat sync, explicit opt-in, retained archives, failed publication and concurrent owner edits. Chat selection tests explicitly create their private-member precondition instead of relying on discovery. The ledger deletion-order test uses a clock after the recorded last write, so filesystem and wall-clock skew cannot mask its unlink assertion. Production retention and workflow behavior are unchanged. The memory, crew, dashboard and security module docs describe the changed default.

The requested default is shared Global V1, not memory disabled. A newly discovered ordinary agent can use that shared memory; it does not get a new isolated empty store. Owners who need private isolation must explicitly create or opt into V2. Existing private-memory checks are unchanged, and this change does not migrate or delete stored data.

Maintainer scope: Memory V2 is still in development, not generally released. Compatibility, migration and recovery for old V2 development data are not requirements of this fix. In particular, reusing a removed private member's identity with retained old V2 records is not promised as a supported V1 migration. No retirement metadata API or UI compatibility layer is introduced. The maintainer authorized the shared-V1 discovery default in the approved First Principles product decision, with explicit permission to carry that same decision to subsequent revisions.

API compatibility: POST /api/agents/sync no longer returns 409 member_memory_unavailable for private provisioning or execution restrictions. It registers ordinary V1 agents instead. Scan and persistence failures still return errors; explicit private creation and opt-in retain their existing refusals. No new UI or configuration flag is introduced.

Tests

  • Initial discovery implementation: 149 focused tests passed across agent sync, private creation capability, member publication and chat selection.
  • Current Windows timing-test changes: Python compilation and Black checks passed; no local tests run, per maintainer request. GitHub CI must verify them.
  • Negative control: all 11 new discovery/opt-in cases failed against the previous behavior before the production fix.
  • Passed: Python compilation, Black, isort, flake8, mypy, docs lint and completed static PR gates.
  • Passed: TypeScript/Vite production build, ESLint and completed i18n gates.
  • The wider backend selection finished with 31,490 passed, 63 skipped and 7 failures. The failures are in test_dev_fleet_app.py, test_member_memory_mcp_routing.py and test_overload_home_fence.py; their cause is not yet established. They are not reported as a clean gate.
  • The maintainer requested immediate submission and no further local tests. The wider frontend run was stopped. Remaining tests and independent reviews are deferred to GitHub CI, without changing any CI requirement.

Manual verification

Real HTTP test clients exercise discovery followed by the existing explicit private-memory update. No live gateway or user memory was changed. Browser verification has not been performed.

Screenshots / video

No frontend component, layout or string changes. This PR changes the backend discovery default; no browser screenshots were captured.

Related Issues

no linked issue: maintainer-requested correction to the automatic discovery default.

Pattern harvest

Not generalizable: discovery and explicit member creation intentionally have different memory-allocation semantics. Behavioral regression tests pin this boundary without introducing a new lint rule.

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@bolichen97
bolichen97 requested review from a team and dwu96 September 18, 2026 00:19
@bolichen97

Copy link
Copy Markdown
Contributor Author

Intent: Keep automatically discovered ordinary agents on Global Memory V1. Create private V2 only through explicit member creation or the existing owner opt-in action.
Not a goal: Do not migrate or downgrade existing V2 stores, widen private-memory permissions, add a new UI or flag, or change explicit creation and package-prune archival.

The maintainer requested immediate submission and no further local tests. Remaining verification runs in GitHub CI; no CI or review requirement is waived.

@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

Design Review (Fable 5) — 🟡 CONCERNS

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

Design-Verdict: CONCERNS

Unexplained test_member_memory_mcp_routing.py failure sits in the exact subsystem this PR re-defaults, and its cause is unestablished at submission.

Watch

  • The description reports 7 backend failures whose "cause is not yet established," one being test_member_memory_mcp_routing.py — if MCP memory routing assumes a discovered member owns a private store, a V1-default discovered agent could misroute memory at runtime, which is the end-to-end path this fix changes.
    Clears when: CI is green on this revision, or the three failures are shown pre-existing on main.
  • The test_work_ledger.py clock-pinning hunk targets Windows wall-clock skew, ran under "no local tests run, per maintainer request," and shares no root cause with the discovery default — a Windows-only regression here would be misattributed to this memory change on revert.
    Clears when: Windows CI passes, or the hunk moves to its own PR.

Suggestions

  • Split the ledger-clock test hardening into its own test: PR; the repo's one-logical-change rule exists precisely so a revert of the discovery default doesn't drag an unrelated Windows fix with it.

[DESIGN-REVIEWED] f2f5a54

@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Opus 4.8 Review — ✅ no blocking findings

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

Review details

Confirmed: KiroCrewAgentConfig().memory_store == "default" (the always-valid Global V1 store), so discovered agents registering without a private store cannot crash or reference a nonexistent binding. The removed locals and imports leave no dangling references, existing V1/V2 bindings are untouched, the prune path's V2 archival logic is unchanged, and the docs/tests are updated consistently with the intended owner-opt-in design. No grounded defect at the 80+ bar.

No findings.

[OPUS-REVIEWED] f2f5a54

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

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

@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 f2f5a54bdc784af7ea42b592000b5131eeb077e8 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] f2f5a54

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

@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — ✅ human override accepted

@bolichen97 overrode this lane for f2f5a54bdc784af7ea42b592000b5131eeb077e8 via /ai-review override (this commit only).

@bolichen97

Copy link
Copy Markdown
Contributor Author

span=5cfc52ae0386

fixed: The PR description now names the removed discovery-only 409 member_memory_unavailable response and explains that discovery registers V1 instead. Scan/persistence failures remain errors; explicit private creation and opt-in still retain their original admission refusals.
This is a description correction for commit 7168d7b, not a code change or a CI waiver.

@bolichen97

Copy link
Copy Markdown
Contributor Author

span=4bac962a3a96

rebutted: The originating owner instruction was explicitly that ordinary agents remain on V1 and V2 is created only when explicitly enabled, not that agents have no memory. The shared Global V1 default is the intended implementation direction, as recorded in the intent comment before this review.
The privacy trade is real: a discovered or reinstalled agent uses shared Global V1 rather than a new isolated empty store. The PR description now states that trade directly and directs owners needing isolation to the existing explicit V2 action. Existing V2 bindings, files and private execution checks are unchanged.
This agent records the already-given product instruction; this comment is not a review override or a claim that CI has passed.

@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
@bolichen97

Copy link
Copy Markdown
Contributor Author

span=ac4a39fc9293

needs-a-decision: @bolichen97, the implementation follows your requested Global V1 default for ordinary discovered agents, but this lane requires a repository-recorded product ruling rather than the agent quoting task instructions. Please confirm whether to record the SHA-bound First Principles override for this intended default. The agent has not issued an override.
Shared Global V1 for newly discovered or reinstalled agents is the explicit trade; existing V2 remains private. CI and other review gates remain required.

@bolichen97

Copy link
Copy Markdown
Contributor Author

span=971703c52762

needs-a-decision: @bolichen97, no accepted base-branch RFC covers this changed discovery default. The minimal proposed resolution is your explicit SHA-bound First Principles decision for this same-repository PR, not a code change to evade the gate. Awaiting your authorization; no override or merge has been performed.

@bolichen97

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles 7168d7b: Maintainer decision, explicitly authorized by bolichen: ordinary discovered and reinstalled agents must default to shared Global Memory V1, not automatically receive private V2. Private V2 requires explicit member creation or owner opt-in. The shared-memory trade is intentional; existing V2 bindings and isolation remain unchanged. This approves the product-default decision only and does not waive CI or other review gates.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@bolichen97 marked the first-principles AI finding as false positive, not applicable, or explicitly accepted for 7168d7b3ac90eadc91ae78275d7023534f8bd47c.

Maintainer decision, explicitly authorized by bolichen: ordinary discovered and reinstalled agents must default to shared Global Memory V1, not automatically receive private V2. Private V2 requires explicit member creation or owner opt-in. The shared-memory trade is intentional; existing V2 bindings and isolation remain unchanged. This approves the product-default decision only and does not waive CI or other review gates.

This decision applies only to this commit. A new push requires a new judgment.

@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
@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Fable 5) — ⏭️ skipped

Revision f2f5a54bdc784af7ea42b592000b5131eeb077e8 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Advisory — does not block merge.

@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
@bolichen97
bolichen97 force-pushed the fix/agent-sync-v1-default branch from f7db15b to 1793bea Compare September 18, 2026 02:22
@bolichen97

bolichen97 commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles 1793bea: Maintainer-authorized decision: discovered agents default to shared Global V1; V2 requires explicit creation or opt-in. V2 is unreleased development work, so old V2 data compatibility is out of scope. No stored data is deleted and existing isolation checks remain. This carries the same approved decision to this SHA; other CI and review gates still apply.

@github-actions

Copy link
Copy Markdown
Contributor

AI-review override not recorded: keep the reason to 500 characters or fewer.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@bolichen97 marked the first-principles AI finding as false positive, not applicable, or explicitly accepted for 1793beac27e70e64acfcf79bc6e6c2ae2044f00b.

Maintainer-authorized decision: discovered agents default to shared Global V1; V2 requires explicit creation or opt-in. V2 is unreleased development work, so old V2 data compatibility is out of scope. No stored data is deleted and existing isolation checks remain. This carries the same approved decision to this SHA; other CI and review gates still apply.

This decision applies only to this commit. A new push requires a new judgment.

@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=6f3b1c923d19

rebutted: These small test-only changes repair two concrete Windows failures encountered while verifying this PR, and the maintainer explicitly requested direct repair here. They preserve every assertion and production behavior: callbacks wait for the existing driver task, and the deletion-order fixture sets its clock after its own recorded write.
Keeping these three focused test hunks avoids a separate dependency PR solely to validate this fix. Their distinct purpose is recorded in the description; remote CI must still validate them, and no production retention or workflow logic changes.

@bolichen97

Copy link
Copy Markdown
Contributor Author

span=7a5aa49dc697

rebutted: The maintainer explicitly authorized both the squash/push and carrying the same product decision to this revision. A decision naming this exact SHA is posted at #11630 (comment) and the First Principles check is now SUCCESS. The PR description links that current decision rather than relying on the old SHA.
This is not a PR approval or a waiver of CI; those remain separate gates.

@bolichen97
bolichen97 force-pushed the fix/agent-sync-v1-default branch from 1793bea to f5dfd42 Compare September 18, 2026 03:01
@bolichen97

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles f5dfd42: Maintainer-authorized decision: discovered agents default to shared Global V1; V2 requires explicit creation or opt-in. V2 is unreleased development work; old V2 data compatibility is out of scope. This revision only syncs the existing fix onto the upstream test-harness repair. Stored data and isolation checks remain unchanged; all other CI and review gates still apply.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@bolichen97 marked the first-principles AI finding as false positive, not applicable, or explicitly accepted for f5dfd42a2b560bd393144724a5d4e840a91b79bc.

Maintainer-authorized decision: discovered agents default to shared Global V1; V2 requires explicit creation or opt-in. V2 is unreleased development work; old V2 data compatibility is out of scope. This revision only syncs the existing fix onto the upstream test-harness repair. Stored data and isolation checks remain unchanged; all other CI and review gates still apply.

This decision applies only to this commit. A new push requires a new judgment.

@bolichen97
bolichen97 enabled auto-merge (squash) September 18, 2026 03:53
@bolichen97
bolichen97 disabled auto-merge September 18, 2026 03:53
@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Sep 18, 2026
@bolichen97
bolichen97 force-pushed the fix/agent-sync-v1-default branch from f5dfd42 to f2f5a54 Compare September 18, 2026 03:54
@bolichen97

Copy link
Copy Markdown
Contributor Author

/ai-review override first-principles f2f5a54: Maintainer-authorized decision: discovered agents default to shared Global V1; V2 requires explicit creation or opt-in. V2 is unreleased; old development-data compatibility is out of scope. This revision only resolves a test-file conflict against main, preserving both regression assertions and upstream worker tests. Stored data and isolation checks remain unchanged; all other review and CI gates apply.

@github-actions

Copy link
Copy Markdown
Contributor

Human judgment recorded

@bolichen97 marked the first-principles AI finding as false positive, not applicable, or explicitly accepted for f2f5a54bdc784af7ea42b592000b5131eeb077e8.

Maintainer-authorized decision: discovered agents default to shared Global V1; V2 requires explicit creation or opt-in. V2 is unreleased; old development-data compatibility is out of scope. This revision only resolves a test-file conflict against main, preserving both regression assertions and upstream worker tests. Stored data and isolation checks remain unchanged; all other review and CI gates apply.

This decision applies only to this commit. A new push requires a new judgment.

@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
@bolichen97
bolichen97 merged commit e66570d into main Sep 18, 2026
57 of 59 checks passed
@bolichen97
bolichen97 deleted the fix/agent-sync-v1-default branch September 18, 2026 03:55
@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Sep 18, 2026
bolichen97 added a commit that referenced this pull request 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.
bolichen97 added a commit that referenced this pull request 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge conflict Branch has merge conflicts with its base — author must resolve before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant