A request through a Magpie group or fallback names the group, so 0.1.1's onRequest found no provider rule and sent old reasoning, ciphertext and item IDs to members whose filter was on. onProvider now filters each provider try with the tried provider's rule (`magpie:<ctx.provider.id>`, through aliases). A direct provider/model request filtered in onRequest is marked in ctx.state.historyFiltered and its tries pass it on. A try with no rule, a rule off, another protocol, the compact path or history that can't move is returned unchanged (onProvider can't reject). cases.json gains 10 synthetic provider-try cases in the shared scripts/middleware.mjs format (no real data). Run at the reviewed head c50f542 (on mote): - `HOME=$(mktemp -d) bun test`: 3776 pass, 8 skip, 0 fail. - `bun scripts/check.mjs`: exit 0. - PR's tests against the 0.1.1 middleware: 8 fail (the group/fallback cases and the export check), 34 pass. - Probes in magpie's own engine (moejs, origin/main 3bce283df, internal/middleware Run.Request + Run.Tried, not committed): a group with a filtered, an unfiltered, a rule-off member, a retry on the filtered one and a member with another include rule: each try filtered by its own rule, the retry byte-identical to the first, unfiltered tries byte-identical to the request. A direct request: filtered once in onRequest, its try, a retry and a fallback to another provider sent what onRequest left. ctx.state doesn't reach the next request. Red on 0.1.1 (group), red with the historyFiltered guard removed (fallback re-filtered) and red with onProvider setting the flag (retry unfiltered). - PROVENANCE: the shipped files' sha256 match unisong/magpie-codex-history-filter at 43e0b5c, which is on its main. Not tried: a real Magpie with real providers; a group whose members speak different protocols.
44 lines
2.0 KiB
JSON
44 lines
2.0 KiB
JSON
{
|
|
"source": "https://github.com/unisong/magpie-codex-history-filter",
|
|
"commit": "43e0b5c8d5e1542a4bb58054f1c3c7f6ee0e7120",
|
|
"version": "0.1.2",
|
|
"license": "MIT",
|
|
"files": {
|
|
"codex-history.middleware.js": {
|
|
"sha256": "155522beab703641b4ba57f43f347b5a50aeab191463cfcdb0a93cb7e91f56f5"
|
|
},
|
|
"history/portable-web-search.mjs": {
|
|
"sha256": "3ba488941254df46f4ea3aeda5fa0e325d6cb579f2f504a13c005f7f657c5f9d"
|
|
},
|
|
"README.md": {
|
|
"sha256": "97cbb2a1179e4f801b9e50b177a963d5297388c48dbf1ee27a628e3507117c83"
|
|
},
|
|
"package.json": {
|
|
"sha256": "e0552938d8c2e3352c5b512b5f135d6696b82c228f896d6fba3449aa66a1db42"
|
|
},
|
|
"LICENSE": {
|
|
"sha256": "3ce553a5ba020d6cbae538031d05c0700d67ad4d673d832d51022566a9ead2e1"
|
|
}
|
|
},
|
|
"derivedFrom": {
|
|
"source": "https://github.com/unisong/codex-filter-manager",
|
|
"commit": "40f98308f364ca8533c30c11a2cede4ea00542f3",
|
|
"version": "v1.0.5",
|
|
"files": {
|
|
"magpie-plugin/history-filter.mjs": {
|
|
"sha256": "45d969daf0a6185fba2cbf8b76910d7bcb63e012d4767c46863b520f17c80925"
|
|
},
|
|
"magpie-plugin/history.middleware.js": {
|
|
"sha256": "b4da0d27961861904ba8577633717c6e14c36e78508ff95074fa24fb98d76a06"
|
|
}
|
|
}
|
|
},
|
|
"changes": [
|
|
"Inlined the shared history algorithm and request hook into one import-free middleware file.",
|
|
"No model detection, guard, dashboard, proxy service or provider configuration is included.",
|
|
"Version 0.1.1 adds history/portable-web-search.mjs, inlined into the middleware to convert historical native web_search_call items to labeled text after reasoning is removed.",
|
|
"Version 0.1.2 exports onProvider: a request through a Magpie group or fallback is filtered on each provider try with the tried provider's rule. onRequest and onProvider are the only exports.",
|
|
"The files above are byte-identical to the pinned commit in the source repository. derivedFrom names the original baseline; that commit is no longer on a branch or tag since the source repository's public history was rebuilt."
|
|
]
|
|
}
|