Skip to content

docs: fix execution file parsing example#1297

Open
looooown2006 wants to merge 1 commit intoanthropics:mainfrom
looooown2006:docs/fix-execution-file-review-example-1296
Open

docs: fix execution file parsing example#1297
looooown2006 wants to merge 1 commit intoanthropics:mainfrom
looooown2006:docs/fix-execution-file-review-example-1296

Conversation

@looooown2006
Copy link
Copy Markdown

Summary

Fixes the base-action/README.md example for parsing execution_file.

The previous example looked for executionLog[i].role === 'assistant', but the execution log contains SDK events with top-level type fields. Assistant content is nested under message.content, and successful runs also include a final type: "result" event.

This updates the example to:

  • prefer the final result event's result string;
  • fall back to the last assistant text block under message.content;
  • document the existing structured_output and session_id outputs in the base action Outputs table;
  • point typed automations toward --json-schema + structured_output instead of parsing the full execution log.

Tests

  • npx prettier@3.5.3 --check base-action/README.md
  • git diff --check

Note: I did not run bun test / bun run typecheck because Bun is not installed in this local environment. This is a README-only documentation change.

Closes #1296.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs: base-action README example for parsing execution_file uses stale e.role === 'assistant'; current SDK output has top-level e.type

1 participant