Skip to content

Commit 3a0a6e1

Browse files
committed
WIP comments
1 parent 781e641 commit 3a0a6e1

File tree

7 files changed

+31
-21
lines changed

7 files changed

+31
-21
lines changed

characters/logging-addict.character.json

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
"model": "en_US-male-medium"
1111
}
1212
},
13+
// TODO: Setup character so has capacity to load files from RAG. Github issue on how to do this more safely. Be accurate and use good standards. Don't know when / how / TBD
14+
// TODO: Separate what we want them to load as relates to 10 categories and domains reference https://docs.google.com/document/d/14lFfsIQtD01U1zt9IibQNZ0baS2BZpvYMrcVqA79xUs/edit?pli=1&tab=t.0#heading=h.69bk8194ug4
15+
// Where we want the character to sit in file, in documents, tagging etc.
16+
// TODO: General Engineering character
1317
"plugins": [],
1418
"bio": [
1519
"Always analyzes existing logging infrastructure before making recommendations, believing in extending and improving current patterns rather than replacing them entirely.",

packages/client-github/src/index.ts

+18-15
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ export class GitHubClient extends EventEmitter {
3131
this.runtime = runtime;
3232
this.character = runtime.character;
3333

34-
this.runtime.registerAction(initializeRepositoryAction);
35-
this.runtime.registerAction(createCommitAction);
36-
this.runtime.registerAction(createMemoriesFromFilesAction);
37-
this.runtime.registerAction(createPullRequestAction);
38-
this.runtime.registerAction(createIssueAction);
39-
this.runtime.registerAction(modifyIssueAction);
40-
this.runtime.registerAction(addCommentToIssueAction);
41-
this.runtime.registerAction(ideationAction);
42-
this.runtime.registerAction(addCommentToPRAction);
34+
// this.runtime.registerAction(initializeRepositoryAction);
35+
// this.runtime.registerAction(createCommitAction);
36+
// this.runtime.registerAction(createMemoriesFromFilesAction);
37+
// this.runtime.registerAction(createPullRequestAction);
38+
// this.runtime.registerAction(createIssueAction);
39+
// this.runtime.registerAction(modifyIssueAction);
40+
// this.runtime.registerAction(addCommentToIssueAction);
41+
// this.runtime.registerAction(ideationAction);
42+
// this.runtime.registerAction(addCommentToPRAction);
4343
elizaLogger.log("GitHubClient actions and providers registered.");
4444

4545
// Start the OODA loop after initialization
@@ -55,11 +55,12 @@ export class GitHubClient extends EventEmitter {
5555
}
5656

5757
private startOodaLoop() {
58-
const interval = Number(this.runtime.getSetting("GITHUB_OODA_INTERVAL_MS")) || 300000; // Default to 5 minutes
59-
elizaLogger.log("Starting OODA loop with interval:", interval);
60-
setInterval(() => {
61-
this.processOodaCycle();
62-
}, interval);
58+
this.processOodaCycle();
59+
// const interval = Number(this.runtime.getSetting("GITHUB_OODA_INTERVAL_MS")) || 300000; // Default to 5 minutes
60+
// elizaLogger.log("Starting OODA loop with interval:", interval);
61+
// setInterval(() => {
62+
// this.processOodaCycle();
63+
// }, interval);
6364
}
6465

6566
private async processOodaCycle() {
@@ -70,7 +71,7 @@ export class GitHubClient extends EventEmitter {
7071
elizaLogger.error("GITHUB_OWNER or GITHUB_REPO is not set, skipping OODA cycle.");
7172
throw new Error("GITHUB_OWNER or GITHUB_REPO is not set");
7273
}
73-
74+
// TODO: We generate this, we want the default one that gets generated
7475
const roomId = getRepositoryRoomId(this.runtime);
7576
elizaLogger.log("Repository room ID:", roomId);
7677

@@ -193,6 +194,7 @@ export class GitHubClient extends EventEmitter {
193194
// time to initialize repository and create memories
194195
const timestamp = Date.now();
195196
const userIdUUID = stringToUuid(`${this.runtime.agentId}-${timestamp}`);
197+
// TODO: Are we saving all the right values in content
196198
const originalMemory: Memory = {
197199
id: stringToUuid(`${roomId}-${this.runtime.agentId}-${timestamp}-original`),
198200
userId: userIdUUID,
@@ -246,6 +248,7 @@ export class GitHubClient extends EventEmitter {
246248
action: createMemoriesFromFilesMemory.content.action,
247249
userId: this.runtime.agentId,
248250
});
251+
// This returns nothing no issue memories or pull request memories
249252
const issuesMemories = await saveIssuesToMemory(this.runtime, owner, repository, this.apiToken);
250253
elizaLogger.log("Issues memories:", issuesMemories);
251254
const pullRequestsMemories = await savePullRequestsToMemory(this.runtime, owner, repository, this.apiToken);

packages/client-github/src/templates.ts

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ export const oodaTemplate = `
3333
}
3434
\`\`\`
3535
36-
3736
Examples:
3837
1. CREATE_ISSUE:
3938
{

packages/plugin-github/src/plugins/addCommentToIssue.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
} from "../types";
2121
import { addCommentToIssueTemplate, generateCommentForASpecificIssueTemplate } from "../templates";
2222
import { getIssueFromMemories, incorporateRepositoryState } from "../utils";
23+
import fs from "fs/promises";
2324

2425
export const addCommentToIssueAction: Action = {
2526
name: "ADD_COMMENT_TO_ISSUE",
@@ -54,7 +55,9 @@ export const addCommentToIssueAction: Action = {
5455
state: updatedState,
5556
template: addCommentToIssueTemplate,
5657
});
57-
58+
// Test all all values from the state are being loaded into the context (files, previousIssues, previousPRs, all issues all prs )
59+
// write the context to a file for testing
60+
await fs.writeFile("context.txt", context);
5861
const details = await generateObject({
5962
runtime,
6063
context,

packages/plugin-github/src/plugins/addCommentToPR.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
} from "../types";
2121
import { addCommentToPRTemplate, generateCommentForASpecificPRTemplate } from "../templates";
2222
import { getPullRequestFromMemories, incorporateRepositoryState } from "../utils";
23+
import fs from "fs/promises";
2324

2425
export const addCommentToPRAction: Action = {
2526
name: "ADD_COMMENT_TO_PR",
@@ -54,7 +55,8 @@ export const addCommentToPRAction: Action = {
5455
state: updatedState,
5556
template: addCommentToPRTemplate,
5657
});
57-
58+
// write the context to a file for testing
59+
await fs.writeFile("context.txt", context);
5860
const details = await generateObject({
5961
runtime,
6062
context,
@@ -100,7 +102,7 @@ export const addCommentToPRAction: Action = {
100102
state: updatedState,
101103
template: generateCommentForASpecificPRTemplate,
102104
});
103-
105+
104106
const commentDetails = await generateObject({
105107
runtime,
106108
context: commentContext,

packages/plugin-github/src/plugins/ideationPlugin.ts

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { ideationTemplate } from "../templates";
1515
import { IdeationSchema, isIdeationContent } from "../types";
1616
import { getRepositoryRoomId, incorporateRepositoryState } from "../utils";
1717
import fs from "fs/promises";
18+
1819
export const ideationAction: Action = {
1920
name: "IDEATION",
2021
similes: ["THINK","IDEATE", "IDEAS", "IDEATION", "CO_CREATION", "BRAINSTORM", "THOUGHTS", "SUGGESTIONS", "THINKING"],

packages/plugin-github/src/templates.ts

-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ Provide your response in the following JSON format:
4141
* Goals Data: {{goalsData}}
4242
* Recent Interactions: {{recentInteractions}}
4343
* Here is the convo so far: {{formattedConversation}}
44-
45-
4644
*/
4745
export const initializeTemplate = `
4846
Extract the details for initializing the GitHub repository:

0 commit comments

Comments
 (0)