Skip to content

Commit d245b10

Browse files
GPT 5 Support. Slack bot updates
1 parent 0b3b835 commit d245b10

20 files changed

Lines changed: 326 additions & 191 deletions

package-lock.json

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"test:postgres": " node --env-file=variables/test.env ./node_modules/mocha/bin/mocha -r esbuild-register -r \"./src/test/testSetup.ts\" \"src/modules/postgres/*.test.ts\" --timeout 10000",
5050
"test:mongo": " node --env-file=variables/test.env ./node_modules/mocha/bin/mocha -r esbuild-register -r \"./src/test/testSetup.ts\" \"src/modules/mongo/*.test.ts\" --timeout 10000",
5151
"test:db": " node --env-file=variables/test.env ./node_modules/mocha/bin/mocha -r esbuild-register -r \"./src/test/testSetup.ts\" \"src/modules/{firestore,mongo,postgres}/*.test.ts\" --timeout 10000",
52+
"test:single": " node --env-file=variables/test.env ./node_modules/mocha/bin/mocha -r esbuild-register -r \"./src/test/testSetup.ts\" --timeout 10000 --exit",
5253
"test:ci:firestore": "firebase emulators:exec --only firestore \"npm run test:firestore\"",
5354
"test:ci:postgres": " npm run test:postgres",
5455
"test:ci:mongo": " npm run test:mongo",
@@ -99,7 +100,7 @@
99100
"@grpc/grpc-js": "^1.12.6",
100101
"@microsoft/tiktokenizer": "^1.0.8",
101102
"@mistralai/mistralai": "^1.7.1",
102-
"@modelcontextprotocol/sdk": "^1.13.2",
103+
"@modelcontextprotocol/sdk": "^1.17.1",
103104
"@mozilla/readability": "^0.6.0",
104105
"@octokit/request": "^5.1.0",
105106
"@openrouter/ai-sdk-provider": "^0.4.5",

src/agent/agentContext.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { deserializeContext, serializeContext } from '#agent/agentSerialization'
66
import type { RunAgentConfig } from '#agent/autonomous/autonomousAgentRunner';
77
import { appContext } from '#app/applicationContext';
88
import { LlmTools } from '#functions/llmTools';
9-
import { openaiGPT41 } from '#llm/services/openai';
9+
import { openaiGPT5 } from '#llm/services/openai';
1010
import type { AgentContext } from '#shared/agent/agent.model';
1111
import { functionRegistry } from '../functionRegistry';
1212

@@ -19,10 +19,10 @@ describe('agentContext', () => {
1919
describe('serialisation', () => {
2020
it('should be be identical after serialisation and deserialization', async () => {
2121
const llms = {
22-
easy: openaiGPT41(),
23-
medium: openaiGPT41(),
24-
hard: openaiGPT41(),
25-
xhard: openaiGPT41(),
22+
easy: openaiGPT5(),
23+
medium: openaiGPT5(),
24+
hard: openaiGPT5(),
25+
xhard: openaiGPT5(),
2626
};
2727
// We want to check that the FileSystem gets re-added by the resetFileSystemFunction function
2828
const functions = new LlmFunctionsImpl(LlmTools); // FileSystemRead

src/agent/autonomous/agentCompletion.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@ import type { FunctionCallResult } from '#shared/llm/llm.model';
44
import { envVar } from '#utils/env-var';
55

66
/**
7-
* Runs the completionHandler on an agent
8-
* @param agent
7+
* Executes the completion handler for a given agent. If the handler throws an error, it logs an error.
8+
* @param agent - The agent context containing the completion handler to be invoked.
99
*/
1010
export async function runAgentCompleteHandler(agent: AgentContext): Promise<void> {
1111
try {
1212
await agent.completedHandler?.notifyCompleted(agent);
1313
} catch (e) {
14-
logger.warn(e, `Completion handler error for agent ${agent.agentId}`);
15-
throw e;
14+
logger.error(e, `Completion handler error for agent ${agent.agentId}`);
1615
}
1716
}
1817

src/agent/autonomous/autonomousAgentRunner.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -383,10 +383,6 @@ async function checkRepoHomeAndWorkingDirectory(agent: AgentContext) {
383383
agent.typedAiRepoDir = currentRepoDir;
384384
}
385385
const workingDir = fss.getWorkingDirectory();
386-
logger.info({ workingDir }, 'Verifying working directory exists');
387386
const workDirExists = await fss.directoryExists(workingDir);
388-
if (!workDirExists) {
389-
throw new Error(`Working directory ${workingDir} does not exist or is not a directory.`);
390-
}
391-
logger.info({ workingDir }, 'Working directory verified.');
387+
if (!workDirExists) throw new Error(`Working directory ${workingDir} does not exist or is not a directory.`);
392388
}

src/cli/cli.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { MAD_Balanced, MAD_Fast, MAD_SOTA } from '#llm/multi-agent/reasoning-deb
66
import { Claude4_1_Opus_Vertex } from '#llm/services/anthropic-vertex';
77
import { cerebrasQwen3_235b_Thinking, cerebrasQwen3_Coder } from '#llm/services/cerebras';
88
import { defaultLLMs } from '#llm/services/defaultLlms';
9-
import { openAIo3 } from '#llm/services/openai';
9+
import { openaiGPT5, openaiGPT5mini, openaiGPT5nano } from '#llm/services/openai';
1010
import { perplexityDeepResearchLLM, perplexityLLM, perplexityReasoningProLLM } from '#llm/services/perplexity-llm';
1111
import { xai_Grok4 } from '#llm/services/xai';
1212
import { logger } from '#o11y/logger';
@@ -21,7 +21,9 @@ export const LLM_CLI_ALIAS: Record<string, () => LLM> = {
2121
f: cerebrasQwen3_235b_Thinking,
2222
cc: cerebrasQwen3_Coder,
2323
x: xai_Grok4,
24-
o3: openAIo3,
24+
g5: openaiGPT5,
25+
g5m: openaiGPT5mini,
26+
g5n: openaiGPT5nano,
2527
madb: MAD_Balanced,
2628
mads: MAD_SOTA,
2729
madf: MAD_Fast,

src/cli/gen.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import '#fastify/trace-init/trace-init'; // leave an empty line next so this doesn't get sorted from the first line
22

33
import { writeFileSync } from 'node:fs';
4-
import { initInMemoryApplicationContext } from '#app/applicationContext';
4+
import { initApplicationContext, initInMemoryApplicationContext } from '#app/applicationContext';
55
import { ReasonerDebateLLM } from '#llm/multi-agent/reasoning-debate';
66
import { defaultLLMs } from '#llm/services/defaultLlms';
77
import { countTokens } from '#llm/tokens';
@@ -13,11 +13,13 @@ import { parsePromptWithImages } from './promptParser';
1313
// npm run gen
1414

1515
async function main() {
16-
await initInMemoryApplicationContext();
17-
1816
const { initialPrompt: rawPrompt, llmId, flags } = parseProcessArgs();
1917
const { textPrompt, userContent } = parsePromptWithImages(rawPrompt);
2018

19+
// -s save to database
20+
if (flags.s) await initApplicationContext();
21+
else await initInMemoryApplicationContext();
22+
2123
let llm: LLM = defaultLLMs().medium;
2224
if (llmId) {
2325
if (!LLM_CLI_ALIAS[llmId]) {

src/functions/scm/git.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export class Git implements VersionControlSystem {
7474

7575
// The fix is to execute a specific commit command that targets only the added files.
7676
const commitResult = await execCommand(`git commit -m ${arg(commitMessage)} -- ${filesToAdd}`);
77-
// Pre-commit hooks make call lint/commit commands with
77+
// Pre-commit hooks may make call lint/commit commands with characters for colours etc
7878
commitResult.stdout = formatAnsiWithMarkdownLinks(commitResult.stdout);
7979
failOnError(`Failed to commit changes for files: ${files.join(', ')}`, commitResult);
8080
}

src/llm/multi-agent/blackberry.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { BaseLLM } from '#llm/base-llm';
22
import { Claude4_Sonnet_Vertex } from '#llm/services/anthropic-vertex';
33
import { fireworksLlama3_405B } from '#llm/services/fireworks';
4-
import { openaiGPT41 } from '#llm/services/openai';
4+
import { openaiGPT5 } from '#llm/services/openai';
55
import { logger } from '#o11y/logger';
66
import type { GenerateTextOptions, LLM } from '#shared/llm/llm.model';
77

@@ -65,7 +65,7 @@ const MIND_OVER_DATA_SYS_PROMPT = `When addressing a problem, employ "Comparativ
6565
`;
6666

6767
export class Blackberry extends BaseLLM {
68-
llms: LLM[] = [Claude4_Sonnet_Vertex(), openaiGPT41(), Claude4_Sonnet_Vertex()];
68+
llms: LLM[] = [Claude4_Sonnet_Vertex(), openaiGPT5(), Claude4_Sonnet_Vertex()];
6969
mediator: LLM = Claude4_Sonnet_Vertex();
7070

7171
constructor() {

src/llm/multi-agent/reasoning-debate.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { FastMediumLLM } from '#llm/multi-agent/fastMedium';
44
import { anthropicClaude4_Sonnet } from '#llm/services/anthropic';
55
import { Claude4_1_Opus_Vertex, Claude4_Sonnet_Vertex } from '#llm/services/anthropic-vertex';
66
import { deepinfraDeepSeekR1 } from '#llm/services/deepinfra';
7-
import { openAIo3 } from '#llm/services/openai';
7+
import { openaiGPT5 } from '#llm/services/openai';
88
import { vertexGemini_2_5_Pro } from '#llm/services/vertexai';
99
import { xai_Grok4 } from '#llm/services/xai';
1010
import { logger } from '#o11y/logger';
@@ -83,7 +83,7 @@ export function MAD_Balanced(): LLM {
8383
return new ReasonerDebateLLM(
8484
'Balanced',
8585
vertexGemini_2_5_Pro,
86-
[vertexGemini_2_5_Pro, xai_Grok4, openAIo3],
86+
[vertexGemini_2_5_Pro, xai_Grok4, openaiGPT5],
8787
'MAD:Balanced multi-agent debate (Gemini 2.5 Pro, Grok 4, o3)',
8888
);
8989
}
@@ -92,7 +92,7 @@ export function MAD_Balanced4(): LLM {
9292
return new ReasonerDebateLLM(
9393
'Balanced4',
9494
vertexGemini_2_5_Pro,
95-
[vertexGemini_2_5_Pro, xai_Grok4, openAIo3, Claude4_Sonnet_Vertex],
95+
[vertexGemini_2_5_Pro, xai_Grok4, openaiGPT5, Claude4_Sonnet_Vertex],
9696
'MAD:Balanced multi-agent debate (Gemini 2.5 Pro, Grok 4, o3, Sonnet 4)',
9797
);
9898
}
@@ -116,7 +116,7 @@ export function MAD_Anthropic(): LLM {
116116
}
117117

118118
export function MAD_OpenAI(): LLM {
119-
return new ReasonerDebateLLM('OpenAI', openAIo3, [openAIo3, openAIo3, openAIo3], 'MAD:OpenAI multi-agent debate (o3 x3)');
119+
return new ReasonerDebateLLM('OpenAI', openaiGPT5, [openaiGPT5, openaiGPT5, openaiGPT5], 'MAD:OpenAI multi-agent debate (GPT5 x3)');
120120
}
121121

122122
export function MAD_Grok(): LLM {
@@ -126,9 +126,9 @@ export function MAD_Grok(): LLM {
126126
export function MAD_SOTA(): LLM {
127127
return new ReasonerDebateLLM(
128128
'SOTA',
129-
xai_Grok4,
130-
[openAIo3, Claude4_1_Opus_Vertex, vertexGemini_2_5_Pro, xai_Grok4],
131-
'MAD:SOTA multi-agent debate (Opus 4, o3, Gemini 2.5 Pro, Grok 4)',
129+
openaiGPT5,
130+
[openaiGPT5, Claude4_1_Opus_Vertex, vertexGemini_2_5_Pro, xai_Grok4],
131+
'MAD:SOTA multi-agent debate (Opus 4, GPT5, Gemini 2.5 Pro, Grok 4)',
132132
);
133133
}
134134

0 commit comments

Comments
 (0)