Skip to content

Clamp read_file limits in generated agent templates#76

Open
Gujiassh wants to merge 1 commit intoshareAI-lab:mainfrom
Gujiassh:fix/template-read-file-limit-clamp
Open

Clamp read_file limits in generated agent templates#76
Gujiassh wants to merge 1 commit intoshareAI-lab:mainfrom
Gujiassh:fix/template-read-file-limit-clamp

Conversation

@Gujiassh
Copy link

Summary

  • clamp read_file(limit) in the agent-builder reference template so limit=0 and negative values no longer fall back to the old unlimited behavior
  • propagate the same read_file(limit) support into the level-1 scaffold generator so newly created agents stay aligned with the runtime examples
  • add a small runtime type guard for template dispatch so invalid non-integer limit values fail with a clear error

Validation

  • python3 -m py_compile skills/agent-builder/references/tool-templates.py
  • python3 -m py_compile skills/agent-builder/scripts/init_agent.py
  • python3 skills/agent-builder/scripts/init_agent.py demo-agent --level 1 --path .cache/init-agent-verify
  • verified the generated sample includes read_limit_schema=True, read_limit_logic=True, read_limit_clamp=True, and read_limit_suffix=True

Notes

  • this PR is intentionally separate from #68; it fixes the same read_file(limit) edge case in the agent-builder template/scaffold layer rather than in the runtime teaching agents

Keep the agent-builder reference template and scaffold output aligned with the runtime clamp so generated agents handle zero and negative limits predictably.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@vercel
Copy link

vercel bot commented Mar 12, 2026

@Gujiassh is attempting to deploy a commit to the crazyboym's projects Team on Vercel.

A member of the Team first needs to authorize it.

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