mirror of
https://github.com/SikongJueluo/pi-extensions.git
synced 2026-10-05 11:52:55 +08:00
fix(deps): adapt to pi-permission-system 32 session-keyed services
- resolve the permissions service by the live session id in both tryRegister paths, so a mid-session republish re-keys via the re-emitted permissions:ready channel - read the session probe instead of the start-time snapshot for inner-cmd - pass the session key to publish/unpublishPermissionsService in tests and drop the removed PromptPermissionDetails.message field - raise the ai-judge peer floor to @gotgenes/pi-permission-system >=32.0.0 - bump dev deps: pi-coding-agent 0.85.1, vitest 5, typescript 7
This commit is contained in:
@@ -67,7 +67,6 @@ function bashDetails(
|
||||
requestId: "req-1",
|
||||
source: "tool_call",
|
||||
agentName,
|
||||
message: "May I run bash?",
|
||||
payload: {
|
||||
kind: "bash",
|
||||
request: {
|
||||
|
||||
@@ -76,6 +76,9 @@ function createFakeSessionManager(
|
||||
} as unknown as ExtensionContext["sessionManager"];
|
||||
}
|
||||
|
||||
/** The default fake session id — the key the service publishes under. */
|
||||
const SESSION_ID = "session-root";
|
||||
|
||||
describe("permissions:ready -> registerAuthorizer lifecycle", () => {
|
||||
let registerAuthorizer: ReturnType<typeof vi.fn>;
|
||||
let disposer: ReturnType<typeof vi.fn>;
|
||||
@@ -104,7 +107,7 @@ describe("permissions:ready -> registerAuthorizer lifecycle", () => {
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
if (published) unpublishPermissionsService(service);
|
||||
if (published) unpublishPermissionsService(SESSION_ID, service);
|
||||
});
|
||||
|
||||
/**
|
||||
@@ -113,7 +116,7 @@ describe("permissions:ready -> registerAuthorizer lifecycle", () => {
|
||||
* available, so an early `session_start` cannot register yet.
|
||||
*/
|
||||
function becomeReady(): void {
|
||||
publishPermissionsService(service);
|
||||
publishPermissionsService(SESSION_ID, service);
|
||||
published = true;
|
||||
}
|
||||
|
||||
@@ -228,7 +231,6 @@ describe("permissions:ready -> registerAuthorizer lifecycle", () => {
|
||||
requestId: "req-1",
|
||||
source: "tool_call",
|
||||
agentName: "child",
|
||||
message: "forwarded ask",
|
||||
payload: {
|
||||
kind: "forwarded",
|
||||
request: {
|
||||
|
||||
Reference in New Issue
Block a user