Skip to content

Commit f018ccf

Browse files
committed
Update opencode plugin and test files
1 parent d614994 commit f018ccf

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

.opencode/agent/opencode-plugin-agent-creator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ description: >-
2828
The URL reference indicates intent to use plugins for agent creation, so proactively use the opencode-plugin-agent-creator agent.
2929
</commentary>
3030
</example>
31-
mode: primary
31+
mode: all
3232
---
3333
You are an expert OpenCode Plugin Integrator and Agent Architect, specializing in creating high-performance agent configurations by deeply analyzing OpenCode plugin documentation and integrating their capabilities into precise, effective agent specs. Your expertise encompasses reading and interpreting plugin details from sources like https://opencode.ai/docs/plugins/, understanding @opencode-ai/plugin references, and translating them into autonomous agent designs that align with project standards.
3434

.opencode/plugin/github-integration.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* GitHub Integration Plugin for opencode.
33
* Handles posting session summaries to PR comments and notifying on cargo-test failures.
44
*/
5-
export const GitHubIntegrationPlugin = async ({ client, $, worktree }) => {
5+
export const GitHubIntegrationPlugin = async ({ client, $ }) => {
66
let currentPrNumber = null;
77

88
return {
@@ -13,7 +13,7 @@ export const GitHubIntegrationPlugin = async ({ client, $, worktree }) => {
1313
if (currentPrNumber) {
1414
try {
1515
const summary = await client.session.summarize({ path: { id: event.properties.sessionId } });
16-
await $`gh pr comment ${currentPrNumber} --body "${summary}"`;
16+
await $`gh pr comment ${currentPrNumber} --body "${JSON.stringify(summary)}"`;
1717
} catch (error) {
1818
console.error("Failed to post PR comment:", error.message);
1919
}

.opencode/tests/plugin/github-integration.test.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ describe('GitHubIntegrationPlugin', () => {
77
mockProject = {};
88
mockClient = {
99
session: {
10-
summarize: jest.fn().mockResolvedValue('Test summary'),
10+
summarize: jest.fn().mockResolvedValue({ summary: 'Test summary' }),
1111
},
1212
};
1313
mock$ = jest.fn();
@@ -50,7 +50,7 @@ describe('GitHubIntegrationPlugin', () => {
5050
expect(mockClient.session.summarize).toHaveBeenCalledWith({
5151
path: { id: 'session-456' },
5252
});
53-
expect(mock$).toHaveBeenCalledWith(["gh pr comment ", " --body \"", "\""], 123, "Test summary");
53+
expect(mock$).toHaveBeenCalledWith(["gh pr comment ", " --body \"", "\""], 123, JSON.stringify({ summary: 'Test summary' }));
5454
});
5555

5656
test('event handler should do nothing if not session.idle or no prNumber', async () => {

0 commit comments

Comments
 (0)