Skip to content
Merged
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
21 changes: 19 additions & 2 deletions .github/workflows/poem-bot.lock.yml

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

21 changes: 19 additions & 2 deletions .github/workflows/security-alert-burndown.lock.yml

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

2 changes: 1 addition & 1 deletion actions/setup/js/safe_output_handler_manager.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ const HANDLER_MAP = {
* Note: Project-related types (create_project, create_project_status_update, update_project, copy_project)
* require GH_AW_PROJECT_GITHUB_TOKEN and are processed in the dedicated project handler manager
*/
const STANDALONE_STEP_TYPES = new Set(["assign_to_agent", "create_agent_task", "create_project", "create_project_status_update", "update_project", "copy_project", "upload_asset", "noop"]);
const STANDALONE_STEP_TYPES = new Set(["assign_to_agent", "create_agent_session", "create_project", "create_project_status_update", "update_project", "copy_project", "upload_asset", "noop"]);

/**
* Load configuration for safe outputs
Expand Down
14 changes: 7 additions & 7 deletions actions/setup/js/safe_output_handler_manager.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -396,13 +396,13 @@ describe("Safe Output Handler Manager", () => {
const messages = [
{ type: "create_issue", title: "Issue" },
{ type: "update_project", project: "https://github.com/orgs/myorg/projects/42" },
{ type: "create_agent_task", title: "Task" },
{ type: "create_agent_session", title: "Task" },
];

const mockHandler = vi.fn().mockResolvedValue({ success: true });

// Only create_issue handler is available
// update_project and create_agent_task are handled by standalone steps
// update_project and create_agent_session are handled by standalone steps
const handlers = new Map([["create_issue", mockHandler]]);

const result = await processMessages(handlers, messages);
Expand All @@ -422,24 +422,24 @@ describe("Safe Output Handler Manager", () => {

// Third message should also be skipped (standalone step)
expect(result.results[2].success).toBe(false);
expect(result.results[2].type).toBe("create_agent_task");
expect(result.results[2].type).toBe("create_agent_session");
expect(result.results[2].skipped).toBe(true);
expect(result.results[2].reason).toBe("Handled by standalone step");

// Should NOT have logged warnings for standalone step types
expect(core.warning).not.toHaveBeenCalledWith(expect.stringContaining("No handler loaded for message type 'update_project'"));
expect(core.warning).not.toHaveBeenCalledWith(expect.stringContaining("No handler loaded for message type 'create_agent_task'"));
expect(core.warning).not.toHaveBeenCalledWith(expect.stringContaining("No handler loaded for message type 'create_agent_session'"));

// Should have logged debug messages
expect(core.debug).toHaveBeenCalledWith(expect.stringContaining("update_project"));
expect(core.debug).toHaveBeenCalledWith(expect.stringContaining("create_agent_task"));
expect(core.debug).toHaveBeenCalledWith(expect.stringContaining("create_agent_session"));
});

it("should track skipped message types for logging", async () => {
const messages = [
{ type: "create_issue", title: "Issue" },
{ type: "update_project", project: "https://github.com/orgs/myorg/projects/42" },
{ type: "create_agent_task", title: "Task" },
{ type: "create_agent_session", title: "Task" },
{ type: "unknown_type", data: "test" },
{ type: "another_unknown", data: "test2" },
];
Expand All @@ -456,7 +456,7 @@ describe("Safe Output Handler Manager", () => {
// Collect skipped standalone types
const skippedStandaloneResults = result.results.filter(r => r.skipped && r.reason === "Handled by standalone step");
const standaloneTypes = [...new Set(skippedStandaloneResults.map(r => r.type))];
expect(standaloneTypes).toEqual(expect.arrayContaining(["update_project", "create_agent_task"]));
expect(standaloneTypes).toEqual(expect.arrayContaining(["update_project", "create_agent_session"]));

// Collect skipped no-handler types
const skippedNoHandlerResults = result.results.filter(r => !r.success && !r.skipped && r.error?.includes("No handler loaded"));
Expand Down
2 changes: 1 addition & 1 deletion pkg/workflow/notify_comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ func buildSafeOutputJobsEnvVars(jobNames []string) (string, []string) {
urlKey = "pull_request_url"
case "close_discussion":
urlKey = "discussion_url"
case "create_agent_task":
case "create_agent_session":
urlKey = "task_url"
case "push_to_pull_request_branch":
urlKey = "commit_url"
Expand Down
2 changes: 1 addition & 1 deletion pkg/workflow/safe_output_validation_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ var ValidationConfig = map[string]TypeValidationConfig{
"repo": {Type: "string", MaxLength: 256}, // Optional: target repository in format "owner/repo"
},
},
"create_agent_task": {
"create_agent_session": {
DefaultMax: 1,
Fields: map[string]FieldValidation{
"body": {Required: true, Type: "string", Sanitize: true, MaxLength: MaxBodyLength},
Expand Down
2 changes: 1 addition & 1 deletion pkg/workflow/safe_output_validation_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestGetValidationConfigJSON(t *testing.T) {
// Verify all expected types are present
expectedTypes := []string{
"create_issue",
"create_agent_task",
"create_agent_session",
"add_comment",
"create_pull_request",
"add_labels",
Expand Down
6 changes: 3 additions & 3 deletions pkg/workflow/safe_outputs_config_generation.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func generateSafeOutputsConfig(data *WorkflowData) string {
safeOutputsConfig["create_issue"] = config
}
if data.SafeOutputs.CreateAgentSessions != nil {
safeOutputsConfig["create_agent_task"] = generateMaxConfig(
safeOutputsConfig["create_agent_session"] = generateMaxConfig(
data.SafeOutputs.CreateAgentSessions.Max,
1, // default max
)
Expand Down Expand Up @@ -524,7 +524,7 @@ func generateFilteredToolsJSON(data *WorkflowData, markdownPath string) (string,
enabledTools["create_issue"] = true
}
if data.SafeOutputs.CreateAgentSessions != nil {
enabledTools["create_agent_task"] = true
enabledTools["create_agent_session"] = true
}
if data.SafeOutputs.CreateDiscussions != nil {
enabledTools["create_discussion"] = true
Expand Down Expand Up @@ -777,7 +777,7 @@ func addRepoParameterIfNeeded(tool map[string]any, toolName string, safeOutputs
hasAllowedRepos = len(config.AllowedRepos) > 0
targetRepoSlug = config.TargetRepoSlug
}
case "create_agent_task":
case "create_agent_session":
if config := safeOutputs.CreateAgentSessions; config != nil {
hasAllowedRepos = len(config.AllowedRepos) > 0
targetRepoSlug = config.TargetRepoSlug
Expand Down
2 changes: 1 addition & 1 deletion pkg/workflow/tool_description_enhancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func enhanceToolDescription(toolName, baseDescription string, safeOutputs *SafeO
}
}

case "create_agent_task":
case "create_agent_session":
if config := safeOutputs.CreateAgentSessions; config != nil {
if config.Max > 0 {
constraints = append(constraints, fmt.Sprintf("Maximum %d agent task(s) can be created.", config.Max))
Expand Down
Loading