Skip to content

sync readme snippets with code + clean up formatting#43

Open
jssmith wants to merge 1 commit intomainfrom
jssmith/readme_snippet_sync
Open

sync readme snippets with code + clean up formatting#43
jssmith wants to merge 1 commit intomainfrom
jssmith/readme_snippet_sync

Conversation

@jssmith
Copy link
Copy Markdown
Collaborator

@jssmith jssmith commented Jan 29, 2026

What was changed

Why?

Checklist

  1. Closes

  2. How was this tested:

  1. Any docs updates needed?

@activity.defn
async def get_weather(city: str) -> Weather:
"""Get the weather for a given city."""
# introduce a bug
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want test error bugs in the code like this? The risk is that they become part of the training data.

return result
```

### The tool execution handler
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, Claude justifies this change as follows:

The key improvement is that the README now shows the _execute_tool method as part of the complete AgentWorkflow class definition (lines 48-146 in the README), rather than splitting it into a separate code block. This accurately reflects the actual code structure in workflows/agent.py, where _execute_tool is a method of the AgentWorkflow class (lines 84-98).

What improved:

  1. Structural accuracy: The README now shows the full class definition in one code block, matching the actual file structure
  2. Better organization: The heading changed from "Create the tool execution handler" to "The tool execution handler" (line 148), which is more appropriate since it now appears after the code block that already showed the method
  3. Clearer relationship: It's now obvious that _execute_tool is a helper method within the same class, not a separate standalone function

The original structure was misleading because it made _execute_tool appear to be defined separately, when in reality it's just another method in the AgentWorkflow class.

Copy link
Copy Markdown
Collaborator Author

@jssmith jssmith Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't feel strongly about how we go here. Having the method in a separate code block without the class definition was a little strange.

We can revert this if we want but we may need to update the sync script to keep it that way.

return result
```

### The function call handler
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude explains this change as follows:

Before the change:

  • The main agentic loop code block ended at the return result.output_text statement
  • Then there was a heading "### Create the function call handler" with explanation
  • Then a separate code block showing _handle_function_call as if it were defined separately

After the change:

  • The _handle_function_call method is included in the same code block as the main AgentWorkflow class definition (lines 57-75 in the actual code)
  • The heading changed to "### The function call handler" and moved after the complete code block
  • The explanation now correctly describes a method that's already been shown, rather than introducing new code

This accurately reflects the actual structure in workflows/agent.py where _handle_function_call is a method of the AgentWorkflow class (lines 57-75), not a standalone function.

Why this matters:
The original structure was misleading because it suggested the function call handler was defined separately or could be understood in isolation. In reality, it's a helper method within the same class that uses self and is called by the main loop. The new structure makes this relationship clear and matches the actual code organization.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't feel strongly about how we go here. Having the method in a separate code block without the class definition was a little strange. But I can also see how it flows better.

We can revert this if we want but we may need to update the sync script to keep it that way.

@jssmith jssmith marked this pull request as ready for review January 29, 2026 03:33
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.

1 participant