Repository navigation
chore(release): v0.12.5 #1416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(release): v0.12.5 #1416
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -213,6 +213,8 @@ export function resetEnablementMemoForTests(): void { | |
|
|
||
| /** Warn once per workspace, not once per write. */ | ||
| const missingFieldWarned = new Set<number>() | ||
| /** Workspaces already reported missing from the list, so a lag of a few minutes warns once, not on every call. */ | ||
| const missingFromListWarned = new Set<number>() | ||
|
|
||
| /** Whether the bound workspace has memory switched on. | ||
| * | ||
|
|
@@ -244,15 +246,28 @@ async function memoryStatus( | |
| try { | ||
| const workspaces = await WorkspaceApi.listDatamates() | ||
| const match = workspaces.find((w) => w.id === binding.datamateId) | ||
| if (match && match.memoryEnabled === undefined && !missingFieldWarned.has(binding.datamateId)) { | ||
| if (!match) { | ||
| // Missing from the list is not a confirmed toggle. The list lags a workspace created moments ago (one | ||
| // service replica serves it stale for a few minutes), so this is unknown, like a failed request: neither | ||
| // verdict is kept, so cache-only readers say unknown too, and the write path still fails closed on it. | ||
| memoryEnabledCache.delete(binding.datamateId) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WARNING: Clear the cached disabled verdict when the workspace disappears This branch deletes only Reply with
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 70f842c. The missing-from-list branch now also clears
cubic-dev-ai[bot] marked this conversation as resolved.
coderabbitai[bot] marked this conversation as resolved.
|
||
| memoryDisabledMemo.delete(binding.datamateId) | ||
| if (!missingFromListWarned.has(binding.datamateId)) { | ||
| missingFromListWarned.add(binding.datamateId) | ||
| log.warn("workspace missing from the workspace list; memory setting unknown", { workspace: binding.datamateId }) | ||
| } | ||
| return "error" | ||
| } | ||
| missingFromListWarned.delete(binding.datamateId) | ||
| if (match.memoryEnabled === undefined && !missingFieldWarned.has(binding.datamateId)) { | ||
| // Fail-closed is right, but a backend that has not shipped the field | ||
| // turns the whole feature into a silent no-op. Say so once. | ||
| missingFieldWarned.add(binding.datamateId) | ||
| log.warn("workspace has no memory_enabled field; treating memory as disabled", { | ||
| workspace: binding.datamateId, | ||
| }) | ||
| } | ||
| const value = match?.memoryEnabled === true | ||
| const value = match.memoryEnabled === true | ||
| if (value) { | ||
| memoryEnabledCache.set(binding.datamateId, { checkedAt: Date.now() }) | ||
| memoryDisabledMemo.delete(binding.datamateId) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P3:
missingFromListWarnedis keyed only bydatamateId, but workspace IDs are tenant-local. After an account switch, a missing workspace 42 can inherit tenant A's warning suppression in tenant B; scope this set by credential identity aspollMemodoes.Prompt for AI agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not changing this in the release. The set only decides whether one
log.warnline is written. It does not touch the memory verdict: the missing branch returns "error" and caches nothing, for any tenant. The worst case after an account switch is one skipped warning line for the same workspace id in another tenant. That matches the existingmissingFieldWarned, which is keyed the same way. Scoping both by credential would be the consistent change, and it can come in a normal PR.