8000 feat: add Grok/XAI support to the LLM abstraction by bhouston · Pull Request #211 · drivecore/mycoder · GitHub
[go: up one dir, main page]

Skip to content

8000 feat: add Grok/XAI support to the LLM abstraction #211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
default github mode to be on.
  • Loading branch information
bhouston committed Mar 12, 2025
commit 76bf76c47e74966dd79085ee0380c8399d9b89c1
2 changes: 1 addition & 1 deletion packages/agent/src/core/toolAgent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const toolContext: ToolContext = {
userSession: false,
pageFilter: 'simple',
tokenTracker: new TokenTracker(),
githubMode: false,
githubMode: true,
};

// Mock tool for testing
Expand Down
2 changes: 1 addition & 1 deletion packages/agent/src/tools/interaction/agentTools.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const mockContext: ToolContext = {
headless: true,
userSession: false,
pageFilter: 'none',
githubMode: false,
githubMode: true,
};

describe('Agent Tools', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/agent/src/tools/interaction/subAgent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const mockContext: ToolContext = {
headless: true,
userSession: false,
pageFilter: 'none',
githubMode: false,
githubMode: true,
};

describe('subAgentTool', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/agent/src/tools/interaction/userPrompt.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const mockContext: ToolContext = {
headless: true,
userSession: false,
pageFilter: 'none',
githubMode: false,
githubMode: true,
};

describe('userPromptTool', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/agent/src/tools/io/textEditor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const toolContext: ToolContext = {
userSession: false,
pageFilter: 'simple',
tokenTracker: new TokenTracker(),
githubMode: false,
githubMode: true,
};

describe('textEditor', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/agent/src/tools/system/respawn.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const toolContext: ToolContext = {
userSession: false, 6D4E
pageFilter: 'simple',
tokenTracker: new TokenTracker(),
githubMode: false,
githubMode: true,
};
describe('respawnTool', () => {
it('should have correct name and description', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/agent/src/tools/system/shellExecute.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const toolContext: ToolContext = {
userSession: false,
pageFilter: 'simple',
tokenTracker: new TokenTracker(),
githubMode: false,
githubMode: true,
};

describe('shellExecute', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/agent/src/tools/system/shellMessage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const toolContext: ToolContext = {
userSession: false,
pageFilter: 'simple',
tokenTracker: new TokenTracker(),
githubMode: false,
githubMode: true,
};

// Helper function to get instanceId from shellStart result
Expand Down
2 changes: 1 addition & 1 deletion packages/agent/src/tools/system/shellStart.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const toolContext: ToolContext = {
userSession: false,
pageFilter: 'simple',
tokenTracker: new TokenTracker(),
githubMode: false,
githubMode: true,
};
describe('shellStartTool', () => {
beforeEach(() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/agent/src/tools/system/sleep.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const toolContext: ToolContext = {
userSession: false,
pageFilter: 'simple',
tokenTracker: new TokenTracker(),
githubMode: false,
githubMode: true,
};

describe('sleep tool', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/settings/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const projectConfigFile = (): string => getProjectConfigFile();
// Default configuration
const defaultConfig = {
// Add default configuration values here
githubMode: false,
githubMode: true,
headless: true,
userSession: false,
pageFilter: 'none' as 'simple' | 'none' | 'readability',
Expand Down
24 changes: 12 additions & 12 deletions packages/cli/tests/commands/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,18 @@ describe('Config Command', () => {
warn: vi.fn(),
};
vi.mocked(Logger).mockImplementation(() => mockLogger as unknown as Logger);
vi.mocked(getConfig).mockReturnValue({ githubMode: false });
vi.mocked(getConfig).mockReturnValue({ githubMode: true });
vi.mocked(getDefaultConfig).mockReturnValue({
githubMode: false,
githubMode: true,
customPrompt: '',
});
vi.mocked(updateConfig).mockImplementation((config) => ({
githubMode: false,
githubMode: true,
...config,
}));
vi.mocked(getConfigAtLevel).mockReturnValue({});
vi.mocked(clearConfigKey).mockImplementation(() => ({ githubMode: false }));
vi.mocked(clearConfigKey).mockImplementation(() => ({ githubMode: false }));
vi.mocked(clearConfigKey).mockImplementation(() => ({ githubMode: true }));
vi.mocked(clearConfigKey).mockImplementation(() => ({ githubMode: true }));
});

afterEach(() => {
Expand All @@ -107,13 +107,13 @@ describe('Config Command', () => {
it('should filter out invalid config keys in list command', async () => {
// Mock getConfig to return config with invalid keys
vi.mocked(getConfig).mockReturnValue({
githubMode: false,
githubMode: true,
invalidKey: 'some value',
} as any);

// Mock getDefaultConfig to return only valid keys
vi.mocked(getDefaultConfig).mockReturnValue({
githubMode: false,
githubMode: true,
});

await command.handler!({
Expand Down Expand Up @@ -249,13 +249,13 @@ describe('Config Command', () => {
it('should clear a configuration value', async () => {
// Mock getConfig to include the key we want to clear
vi.mocked(getConfig).mockReturnValue({
githubMode: false,
githubMode: true,
customPrompt: 'custom value',
});

// Mock getDefaultConfig to include the key we want to clear
vi.mocked(getDefaultConfig).mockReturnValue({
githubMode: false,
githubMode: true,
customPrompt: '',
});

Expand Down Expand Up @@ -333,7 +333,7 @@ describe('Config Command', () => {

it('should handle non-existent key for clear command', async () => {
vi.mocked(getConfig).mockReturnValue({
githubMode: false,
githubMode: true,
});

await command.handler!({
Expand Down Expand Up @@ -370,13 +370,13 @@ describe('Config Command', () => {
it('should list all configuration values with default indicators', async () => {
// Mock getConfig to return a mix of default and custom values
vi.mocked(getConfig).mockReturnValue({
githubMode: false, // default value
githubMode: true, // default value
customPrompt: 'custom value', // custom value
});

// Mock getDefaultConfig to return the default values
vi.mocked(getDefaultConfig).mockReturnValue({
githubMode: false,
githubMode: true,
customPrompt: '',
});

Expand Down
8 changes: 4 additions & 4 deletions packages/cli/tests/settings/config-defaults.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('Config Defaults for CLI Options', () => {
it('should use config values for headless, userSession, and pageFilter when not provided in args', async () => {
// Setup mock config with default values
vi.mocked(getConfig).mockReturnValue({
githubMode: false,
githubMode: true,
headless: true,
userSession: false,
pageFilter: 'none',
Expand Down Expand Up @@ -96,7 +96,7 @@ describe('Config Defaults for CLI Options', () => {
it('should use command line args for headless, userSession, and pageFilter when provided', async () => {
// Setup mock config with default values
vi.mocked(getConfig).mockReturnValue({
githubMode: false,
githubMode: true,
headless: true, // Default is true
userSession: false, // Default is false
pageFilter: 'none', // Default is none
Expand Down Expand Up @@ -132,7 +132,7 @@ describe('Config Defaults for CLI Options', () => {
it('should test the actual toolAgent call with config defaults', async () => {
// Setup mock config with default values
vi.mocked(getConfig).mockReturnValue({
githubMode: false,
githubMode: true,
headless: true,
userSession: false,
pageFilter: 'none',
Expand Down Expand Up @@ -180,7 +180,7 @@ describe('Config Defaults for CLI Options', () => {
it('should test the actual toolAgent call with command line args', async () => {
// Setup mock config with default values
vi.mocked(getConfig).mockReturnValue({
githubMode: false,
githubMode: true,
headless: true, // Default is true
userSession: false, // Default is false
pageFilter: 'none', // Default is none
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/tests/settings/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('Config', () => {

describe('updateConfig', () => {
it('should update config and write to file', () => {
const currentConfig = { githubMode: false };
const currentConfig = { githubMode: true };
const newConfig = { githubMode: true };
vi.mocked(fs.existsSync).mockReturnValue(true);
vi.mocked(fs.readFileSync).mockReturnValue(JSON.stringify(currentConfig));
Expand All @@ -77,7 +77,7 @@ describe('Config', () => {
});

it('should merge partial config with existing config', () => {
const currentConfig = { githubMode: false, existingSetting: 'value' };
const currentConfig = { githubMode: true, existingSetting: 'value' };
const partialConfig = { githubMode: true };
vi.mocked(fs.existsSync).mockReturnValue(true);
vi.mocked(fs.readFileSync).mockReturnValue(JSON.stringify(currentConfig));
Expand Down
8 changes: 4 additions & 4 deletions packages/cli/tests/settings/configDefaults.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('Config Defaults for CLI Options', () => {
it('should use config values for headless, userSession, and pageFilter when not provided in args', async () => {
// Setup mock config with default values
vi.mocked(getConfig).mockReturnValue({
githubMode: false,
githubMode: true,
headless: true,
userSession: false,
pageFilter: 'none',
Expand Down Expand Up @@ -90,7 +90,7 @@ describe('Config Defaults for CLI Options', () => {
it('should use command line args for headless, userSession, and pageFilter when provided', async () => {
// Setup mock config with default values
vi.mocked(getConfig).mockReturnValue({
githubMode: false,
githubMode: true,
headless: true, // Default is true
userSession: false, // Default is false
pageFilter: 'none', // Default is none
Expand Down Expand Up @@ -126,7 +126,7 @@ describe('Config Defaults for CLI Options', () => {
it('should test the actual toolAgent call with config defaults', async () => {
// Setup mock config with default values
vi.mocked(getConfig).mockReturnValue({
githubMode: false,
githubMode: true,
headless: true,
userSession: false,
pageFilter: 'none',
Expand Down Expand Up @@ -174,7 +174,7 @@ describe('Config Defaults for CLI Options', () => {
it('should test the actual toolAgent call with command line args', async () => {
// Setup mock config with default values
vi.mocked(getConfig).mockReturnValue({
githubMode: false,
githubMode: true,
headless: true, // Default is true
userSession: false, // Default is false
pageFilter: 'none', // Default is none
Expand Down
0