Skip to content
Closed

Hang #878

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@
"shell:test": "npx --prefix packages/shell playwright test simple.spec.ts",
"test": "pnpm run test:local && pnpm run test:live",
"test:live": "pnpm -r --no-sort --stream --workspace-concurrency=1 run test:live",
"test:local": "pnpm -r --no-sort --stream --workspace-concurrency=1 run test:local"
"test:local": "cross-env DEBUG=typeagent*agents* pnpm -r --no-sort --stream --workspace-concurrency=1 run test:local"
},
"devDependencies": {
"@fluidframework/build-tools": "^0.54.0",
"@types/node": "^20.17.28",
"cross-env": "^7.0.3",
"markdown-link-check": "^3.13.7",
"prettier": "^3.5.3",
"shx": "^0.4.0"
Expand Down
3 changes: 2 additions & 1 deletion ts/packages/agents/greeting/src/greetingCommandHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import {
PersonalizedGreetingAction,
} from "./greetingActionSchema.js";
import { conversation as Conversation } from "knowledge-processor";
import { execSync } from "child_process";

export function instantiate(): AppAgent {
return {
Expand All @@ -46,12 +45,14 @@ type GreetingAgentContext = {
async function initializeGreetingAgentContext(): Promise<GreetingAgentContext> {
let given = "";
let sur = "";
/*
try {
const result = execSync("az ad signed-in-user show", { stdio: "pipe" });
const user = JSON.parse(result.toString());
given = user.givenName;
sur = user.surname;
} catch (e) {}
*/

return {
user: {
Expand Down
2 changes: 1 addition & 1 deletion ts/packages/defaultAgentProvider/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"test": "node --no-warnings --experimental-vm-modules ./node_modules/jest/bin/jest.js",
"test:live": "node --no-warnings --experimental-vm-modules ./node_modules/jest/bin/jest.js --testPathPattern=\".*\\.test\\.js\"",
"test:live:debug": "node --inspect-brk --no-warnings --experimental-vm-modules ./node_modules/jest/bin/jest.js --testPathPattern=\".*\\.test\\.js\"",
"test:local": "node --no-warnings --experimental-vm-modules ./node_modules/jest/bin/jest.js --testPathPattern=\".*\\.spec\\.js\"",
"test:local": "node --no-warnings --experimental-vm-modules ./node_modules/jest/bin/jest.js -i --testPathPattern=\".*\\.spec\\.js\"",
"test:local:debug": "node --inspect-brk --no-warnings --experimental-vm-modules ./node_modules/jest/bin/jest.js --testPathPattern=\".*\\.spec\\.js\"",
"tsc": "tsc -b"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,32 @@ import { AppAgent } from "@typeagent/agent-sdk";
import { createAgentRpcClient } from "agent-rpc/client";
import { createChannelProvider } from "agent-rpc/channel";
import { fileURLToPath } from "url";
import { createLimiter } from "common-utils";

export type AgentProcess = {
appAgent: AppAgent;
process: child_process.ChildProcess | undefined;
count: number;
};

const limiter = createLimiter(1);
export async function createAgentProcess(
agentName: string,
modulePath: string,
): Promise<AgentProcess> {
const process = child_process.fork(
fileURLToPath(new URL(`./agentProcess.js`, import.meta.url)),
[agentName, modulePath],
);
return limiter(async () => {
const process = child_process.fork(
fileURLToPath(new URL(`./agentProcess.js`, import.meta.url)),
[agentName, modulePath],
);

return {
process,
appAgent: await createAgentRpcClient(
agentName,
createChannelProvider(process),
),
count: 1,
};
return {
process,
appAgent: await createAgentRpcClient(
agentName,
createChannelProvider(process),
),
count: 1,
};
});
}
3 changes: 3 additions & 0 deletions ts/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading