Skip to content

Commit c89f457

Browse files
test(workspace): await the syncs routing-pin's seeded link starts (#1391)
`seedLocalLink` left the skill sync and memory seed detached. They outlived the file, lost the pin and cache to its hooks, and sent a binding lookup through the next file's fetch stub under that file's credentials (#1363). Claude-Session: https://claude.ai/code/session_0174HUYiaceApqHP7EKMNgnb Co-authored-by: Ralph Sto. Domingo <[email protected]> Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
1 parent 261f982 commit c89f457

1 file changed

Lines changed: 18 additions & 10 deletions

File tree

‎packages/opencode/test/altimate/workspace/routing-pin.test.ts‎

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,24 @@ function clearPin() {
7676
/** The project's own link, naming a DIFFERENT workspace than the pin — the returning-user case
7777
* from the report, where identity said one id and routing said another. */
7878
async function seedLocalLink(datamateId = 7, datamateName = "project-link") {
79-
await recordApprovedBinding(ROOT, {
80-
datamateId,
81-
datamateName,
82-
linkedAt: Date.now(),
83-
repoRemote: "[email protected]:acme/project.git",
84-
// Both identity keys are written explicitly: the strict reader rejects a row where either is
85-
// `undefined` (it accepts `string | null`), so omitting one produces a cache the routing read
86-
// cannot parse — which looks like a product failure in a test that is only mis-seeded.
87-
projectPath: null,
88-
} as never)
79+
// `awaitBackfill`: recording a link starts a skill sync and a memory seed. Left detached, they
80+
// outlive this file — `afterEach` clears the pin and deletes the cache under them, so they fall
81+
// through to a server lookup that runs under the NEXT file's credentials and lands in its fetch
82+
// stub (#1363). Awaiting them keeps that work inside the test that started it.
83+
await recordApprovedBinding(
84+
ROOT,
85+
{
86+
datamateId,
87+
datamateName,
88+
linkedAt: Date.now(),
89+
repoRemote: "[email protected]:acme/project.git",
90+
// Both identity keys are written explicitly: the strict reader rejects a row where either is
91+
// `undefined` (it accepts `string | null`), so omitting one produces a cache the routing read
92+
// cannot parse — which looks like a product failure in a test that is only mis-seeded.
93+
projectPath: null,
94+
} as never,
95+
{ awaitBackfill: true },
96+
)
8997
}
9098

9199
const ORIGINAL_PILOT = process.env.ALTIMATE_WORKSPACE

0 commit comments

Comments
 (0)