mirror of
https://github.com/Ryder-Sun/Meldwork.git
synced 2026-11-07 06:56:03 -10:00
Expire historical Agent authentication evidence
Only use recent successful runtime verification as current authentication evidence; old chat messages and expired successes no longer imply current credentials. Checks: Agent catalog and native readiness tests under Node; Agent catalog tests under Electron.
This commit is contained in:
1 parent
20a3074f7a
commit
96d164382b
2 files changed
+14
-4
No files matched your search
@@ -129,10 +129,7 @@ class LocalWorkspaceAgentCatalog {
|
||||
recoveredRuntimeCredential = true
|
||||
}
|
||||
const runtimeMissing = runtime?.credentialState === 'missing'
|
||||
const verifiedReady = runtime?.credentialState === 'ready'
|
||||
|| state.messages.some(message => (
|
||||
message.role === 'agent' && message.agentKind === agent.kind
|
||||
))
|
||||
const verifiedReady = recentlyVerified(runtime, this.now())
|
||||
const nativeReadySource = nativeState === 'ready'
|
||||
? (native.source || 'native-credential')
|
||||
: ''
|
||||
|
||||
@@ -68,6 +68,19 @@ test('WorkBuddy encrypted desktop login blocks standalone invocation with a spec
|
||||
assert.equal(agents()[0].availabilitySource, 'workbuddy-desktop-locked')
|
||||
})
|
||||
|
||||
test('old Agent replies and expired runtime verification do not imply current authentication', async () => {
|
||||
const { catalog, agents, state } = fixture({
|
||||
detectAgents: async () => [{ kind: 'codex', version: '0.146.0', compatibilityState: 'compatible' }],
|
||||
credentialState: async () => ({ state: 'unknown', source: 'native-config-unknown' }),
|
||||
})
|
||||
state.messages.push({ role: 'agent', agentKind: 'codex' })
|
||||
state.agentRuntime.codex = { credentialState: 'ready', checkedAt: '2026-07-01T00:00:00.000Z' }
|
||||
await catalog.refresh()
|
||||
assert.equal(agents()[0].credentialState, 'unknown')
|
||||
assert.equal(agents()[0].recentlyVerified, false)
|
||||
assert.notEqual(agents()[0].availabilitySource, 'verified-run')
|
||||
})
|
||||
|
||||
test('sidebar visibility preserves a selected WorkBuddy model', async () => {
|
||||
const { catalog, state } = fixture({ detectAgents: async () => [{ kind: 'workbuddy' }] })
|
||||
state.agentPreferences.workbuddy = { modelId: 'native-text' }
|
||||
|
||||
Reference in new issue
Block a user