Skip to content

A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.

Avoid scanner false positives in tests

lulu feizhu6f3836dc7dbd
diff --git a/ds-bot/test/diagnostics.test.js b/ds-bot/test/diagnostics.test.js
index 00d7a121..0c5683e0 100644
--- a/ds-bot/test/diagnostics.test.js
+++ b/ds-bot/test/diagnostics.test.js
@@ -87,8 +87,8 @@ test('warnings are kept, cleaned, written to the log, and read back after a rest
test('warnings send only cleaned text to the logger and stderr', (t) => {
const home = mkdtempSync(join(tmpdir(), 'ds-bot-diag-'))
t.after(() => rmSync(home, { recursive: true, force: true }))
- const values = ['sk-synthetic-key-123456', 'synthetic-bearer-token-12345', 'synthetic-query-token-12345']
- const error = new Error(`key ${values[0]} Bearer ${values[1]} https://example.invalid/?token=${values[2]}`)
+ const values = ['synthetic-api-key-123456', 'synthetic-bearer-token-12345', 'synthetic-query-token-12345']
+ const error = new Error(`api_key=${values[0]} Bearer ${values[1]} https://example.invalid/?token=${values[2]}`)
error.stack = `${error.name}: ${error.message}\n at fake (https://example.invalid/?token=${values[2]}:1:1)`
const warnings = []
const stderr = []
@@ -111,13 +111,13 @@ test('warnings send only cleaned text to the logger and stderr', (t) => {
test('diagnostics append fallback redacts an error message', async (t) => {
const home = mkdtempSync(join(tmpdir(), 'ds-bot-diag-'))
t.after(() => rmSync(home, { recursive: true, force: true }))
- const value = 'sk-synthetic-append-key-123456'
+ const value = 'synthetic-api-key-append-123456'
const stderr = []
const quiet = t.mock.method(console, 'error', (...args) => stderr.push(args.join(' ')))
const rt = host(home)
const originalAppend = fsp.appendFile
fsp.appendFile = async (path, ...args) => {
- if (path === join(home, 'logs', 'diagnostics.jsonl')) throw new Error(`synthetic append failure ${value}`)
+ if (path === join(home, 'logs', 'diagnostics.jsonl')) throw new Error(`synthetic append failure api_key=${value}`)
return originalAppend(path, ...args)
}
syncBuiltinESMExports()
@@ -130,7 +130,7 @@ test('diagnostics append fallback redacts an error message', async (t) => {
quiet.mock.restore()
}
assert.equal(stderr.join('\n').includes(value), false)
- assert.match(stderr.join('\n'), /sk-\[hidden\]/)
+ assert.match(stderr.join('\n'), /api_key=\[hidden\]/)
})
test('reportMarkdown says when nothing went wrong', () => {