Skip to content

Commit 71d390b

Browse files
Merge feat/unfulfilled-keys-meta: announce an equal-count tool swap
The new swap test states this branch's one-line notice. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_0172qrhMa5TQgETASi5hxMqD
2 parents 013b43a + e3d6e0a commit 71d390b

2 files changed

Lines changed: 23 additions & 2 deletions

File tree

‎packages/opencode/src/altimate/workspace/engine-overlay.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -750,12 +750,14 @@ async function reconcile(sessionID: string, directory: string, state: DirectoryS
750750
// from. (multi-model review)
751751
// No report and an empty report are different verdicts (the severity rule
752752
// differs), and so is a change in which declared tools are callable at an equal
753-
// total, so both are in the signature too. (bot review)
753+
// total, so both are in the signature too: the catalog entries themselves, not
754+
// their count, or a swap at an equal count goes unheard. (bot review, codex)
754755
const gaps =
755756
unfulfilled === undefined
756757
? "no-report"
757758
: JSON.stringify((missingReport ?? []).map((u) => [u.integrationId, u.key, u.reason, u.detail ?? ""]))
758-
const signature = `attached:${workspace.key}:${outcome.available}:${outcome.declared ?? "?"}:${served}:${gaps}:${extServed}`
759+
const callable = JSON.stringify([...consumed].sort())
760+
const signature = `attached:${workspace.key}:${outcome.available}:${outcome.declared ?? "?"}:${served}:${callable}:${gaps}:${extServed}`
759761
// A report that is present but malformed is dropped whole (no gap is claimed);
760762
// say so in the log, or the missing reasons are a silent mystery. Checked before
761763
// the announcement is deduplicated, since a malformed report can share its

‎packages/opencode/test/altimate/workspace/engine-overlay.test.ts‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,25 @@ describe("beforeTurn — what a turn boundary does", () => {
651651
expect(h.toasts[1].message).toBe("2 of 2 integration tools available. Details: /workspace")
652652
})
653653

654+
test("a swap of which declared tool is served is announced even at an equal count", async () => {
655+
// Same total, same declared share, a different callable tool. (codex)
656+
const h = install({
657+
declared: { keys: ["dbt_build_model", "dbt_compile_model"], extensionKeys: [] },
658+
tools: { datamate_dbt_build_model: {}, datamate_altimate_knowledge_search: {} },
659+
meta: { [UNFULFILLED_META_KEY]: [] },
660+
})
661+
await beforeTurn("s1")
662+
await beforeTurn("s1")
663+
expect(h.toasts).toHaveLength(1)
664+
h.tools = { datamate_dbt_compile_model: {}, datamate_altimate_knowledge_search: {} }
665+
await beforeTurn("s1")
666+
expect(h.toasts).toHaveLength(2)
667+
expect(h.toasts.map((t) => t.message)).toEqual([
668+
"1 of 2 integration tools available. Details: /workspace",
669+
"1 of 2 integration tools available. Details: /workspace",
670+
])
671+
})
672+
654673
test("a gap whose error text changed under the same reason is announced again", async () => {
655674
// The remediation is the detail; a stale one sends the user after the
656675
// wrong fix. (multi-model review)

0 commit comments

Comments
 (0)