87 lines
7.6 KiB
Plaintext
87 lines
7.6 KiB
Plaintext
✔ model registry keeps original credentials/endpoint intact, rejects stale edits, and forgets only volatile keys on restart (1333.0803ms)
|
||
✔ config import previews exact revisions, keeps secrets volatile, syncs only when enabled and preserves manual edits on conflicts (1164.1443ms)
|
||
✔ real HTTP pool fails over 429 to another model and never repeats completed tools; attempts seal actual request bytes and Run identity (3585.9704ms)
|
||
✔ pool rotation and weights select members on new Runs; disabled and missing credentials are excluded without requests (5366.5035ms)
|
||
✔ 401 blocks the credential revision; updating the key restores availability without leaking error echoes (1747.0949ms)
|
||
✔ queued request cancellation and in-flight disable release only owned leases and do not dispatch another HTTP request (1136.4961ms)
|
||
✔ compiled model-center HTTP API persists public profiles, blocks forged origins, and local operations never invoke a model (2389.606ms)
|
||
✔ model registry disk failures restore routing, pool profiles and credential references without partial updates (783.0563ms)
|
||
✔ model selection and saved configuration commit together and failures preserve the original mode and endpoint (814.7471ms)
|
||
✔ configuration imports roll back the entire batch and retain one usable preview after validation or commit failure (1151.8458ms)
|
||
✔ saved engine budgets verify all Chat/Responses route variants and reject a mismatched output allowance (1168.6738ms)
|
||
✔ owned CC Switch SQLite imports the selected TOML Responses wire_api and leaves unknown clients untouched (1381.3996ms)
|
||
✔ Responses executes one original tool through Runtime, carries encrypted Items, reports raw usage and seals exact wire bytes (2996.4647ms)
|
||
✔ mixed-protocol pool keeps both actual variants and changes route on 429 without re-executing completed tools (3912.209ms)
|
||
▶ Responses incomplete, failed, missing call identity and unsupported hosted outputs never dispatch a tool
|
||
✔ Reject {"body":{"id":"resp_owned","status":"incomplete","output":[{"type":"function_call","id":"fc_partial" (1906.461ms)
|
||
✔ Reject {"body":{"id":"resp_owned","status":"failed","output":[{"type":"function_call","id":"fc_failed","cal (1906.9122ms)
|
||
✔ Reject {"body":{"id":"resp_owned","status":"completed","output":[{"type":"function_call","id":"fc_bad","cal (1928.8754ms)
|
||
✔ Reject {"body":{"id":"resp_owned","status":"completed","output":[{"type":"computer_call","id":"not-supporte (1296.527ms)
|
||
✔ Responses incomplete, failed, missing call identity and unsupported hosted outputs never dispatch a tool (7039.6819ms)
|
||
▶ invalid JSON in a nonstream Chat or Responses tool group prevents every tool and pool replay
|
||
✔ chat-completions (2081.2153ms)
|
||
✔ responses (2080.5379ms)
|
||
✔ invalid JSON in a nonstream Chat or Responses tool group prevents every tool and pool replay (4162.253ms)
|
||
✔ wire adapter preserves tool IDs but never passes Responses-private Items to Chat or another endpoint (0.3055ms)
|
||
✔ connection JSON import accepts explicit Responses protocol and continues to reject unknown protocols without reading client sessions (544.1457ms)
|
||
✔ HTTP download preserves original malformed SSE bytes and artifact SHA instead of decoding invalid UTF8 (2336.2815ms)
|
||
✖ terminated SSE adapts empty optional tool arguments, retains the exact wire bytes and executes the validated batch once (2722.3065ms)
|
||
✔ reported SSE usage survives rejected required arguments "" without dispatching any tool (1396.4399ms)
|
||
✔ reported SSE usage survives rejected required arguments "{\"path\":" without dispatching any tool (1157.9208ms)
|
||
✔ reported SSE usage survives rejected required arguments "null" without dispatching any tool (1234.1828ms)
|
||
✔ a stream without DONE retains reported usage but cannot adapt or execute even an optional tool (1298.4688ms)
|
||
✔ a timeout after reasoning-only fragments creates one unknown receipt and never invents reported tokens (1641.0366ms)
|
||
✔ real Chat SSE carries UTF8 and split tool JSON; Runtime executes only after DONE, stores partial progress and original usage (2366.4535ms)
|
||
✔ Responses typed SSE validates original item identity, terminal data, raw usage and tool result pair (1953.0612ms)
|
||
✔ incomplete network stream retains unknown attempt and never automatically switches pool or dispatches fragment tools (1415.3169ms)
|
||
✔ stopping an active HTTP stream closes only original request and keeps partial text without executing tools (1335.9278ms)
|
||
✔ explicit streaming probe uses actual SSE despite unknown declaration and binds its own original attempt (661.5481ms)
|
||
✔ coalesced initial SSE events publish the latest partial state even when the upstream stays idle (1386.1776ms)
|
||
✔ stream timeout closes the original HTTP response, preserves redacted capture and never retries (868.242ms)
|
||
✔ SSE accepts CR-only final event boundaries and retains exact invalid UTF8 bytes without dispatch (0.7513ms)
|
||
▶ stream parser rejects truncation, finish length, malformed JSON, duplicate sequence, changed final item and oversized data
|
||
✔ reject 0 (0.2119ms)
|
||
✔ reject 1 (0.178ms)
|
||
✔ reject 2 (0.1575ms)
|
||
✔ reject 3 (4.7821ms)
|
||
✔ reject 4 (0.3083ms)
|
||
✔ reject 5 (0.1834ms)
|
||
✔ stream parser rejects truncation, finish length, malformed JSON, duplicate sequence, changed final item and oversized data (6.3774ms)
|
||
ℹ tests 46
|
||
ℹ suites 0
|
||
ℹ pass 45
|
||
ℹ fail 1
|
||
ℹ cancelled 0
|
||
ℹ skipped 0
|
||
ℹ todo 0
|
||
ℹ duration_ms 41525.9633
|
||
|
||
✖ failing tests:
|
||
|
||
test at tests\model-stream.test.mjs:46:1
|
||
✖ terminated SSE adapts empty optional tool arguments, retains the exact wire bytes and executes the validated batch once (2722.3065ms)
|
||
AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
|
||
+ actual - expected
|
||
|
||
+ 'data: {"choices":[{"index":0,"delta":{"content":"读取已完成。"},"finish_reason":null}]}\r\n' +
|
||
- 'data: {"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"id":"empty-inspection","type":"function","function":{"name":"inspect_project","arguments":""}},{"index":1,"id":"valid-file","type":"function","function":{"name":"read_file","arguments":"{\\"path\\":\\"README.md\\"}"}}]},"finish_reason":null}]}\r\n' +
|
||
'\r\n' +
|
||
+ 'data: {"choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}\r\n' +
|
||
- 'data: {"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}]}\r\n' +
|
||
'\r\n' +
|
||
'data: {"choices":[],"usage":{"prompt_tokens":20,"completion_tokens":10}}\r\n' +
|
||
'\r\n' +
|
||
'data: [DONE]\r\n' +
|
||
'\r\n'
|
||
|
||
at TestContext.<anonymous> (file:///D:/Ai-project/REA%E9%80%86%E5%90%91/Agent-Workbench/tests/model-stream.test.mjs:58:10)
|
||
at async Test.run (node:internal/test_runner/test:1409:7)
|
||
at async Test.processPendingSubtests (node:internal/test_runner/test:974:7) {
|
||
generatedMessage: true,
|
||
code: 'ERR_ASSERTION',
|
||
actual: 'data: {"choices":[{"index":0,"delta":{"content":"读取已完成。"},"finish_reason":null}]}\r\n\r\ndata: {"choices":[{"index":0,"delta":{},"finish_reason":"stop"}]}\r\n\r\ndata: {"choices":[],"usage":{"prompt_tokens":20,"completion_tokens":10}}\r\n\r\ndata: [DONE]\r\n\r\n',
|
||
expected: 'data: {"choices":[{"index":0,"delta":{"tool_calls":[{"index":0,"id":"empty-inspection","type":"function","function":{"name":"inspect_project","arguments":""}},{"index":1,"id":"valid-file","type":"function","function":{"name":"read_file","arguments":"{\\"path\\":\\"README.md\\"}"}}]},"finish_reason":null}]}\r\n\r\ndata: {"choices":[{"index":0,"delta":{},"finish_reason":"tool_calls"}]}\r\n\r\ndata: {"choices":[],"usage":{"prompt_tokens":20,"completion_tokens":10}}\r\n\r\ndata: [DONE]\r\n\r\n',
|
||
operator: 'strictEqual',
|
||
diff: 'simple'
|
||
}
|