feat: make repository/issuenumber inputs in tools optional #141

Merged
davide merged 2 commits from feat/optional-tool-params into main 2026-07-10 23:28:36 +00:00
Member

On long context models get lost and hallucinate names and numbers. If omitted we use the correct one and save some tokens.

Changes

  • Converted all tool definitions (close-issue, create-issue, create-issue-comment, create-pr, create-pr-review) from static exports to factory functions
  • Made repository and issueNumber/prNumber parameters optional in the TypeBox schemas
  • Tools now fall back to the context values (from the current Forgejo event) when these parameters are not provided
  • Updated main.ts to instantiate tools via the new factory functions, passing the repository and issue number from the event context

Benefits

  • Saves tokens in LLM prompts by not requiring the agent to specify repository/issue numbers it already knows
  • Reduces hallucination risk on long-context models that may invent incorrect repository names or issue numbers
On long context models get lost and hallucinate names and numbers. If omitted we use the correct one and save some tokens. ## Changes - Converted all tool definitions (`close-issue`, `create-issue`, `create-issue-comment`, `create-pr`, `create-pr-review`) from static exports to factory functions - Made `repository` and `issueNumber`/`prNumber` parameters optional in the TypeBox schemas - Tools now fall back to the context values (from the current Forgejo event) when these parameters are not provided - Updated `main.ts` to instantiate tools via the new factory functions, passing the repository and issue number from the event context ## Benefits - Saves tokens in LLM prompts by not requiring the agent to specify repository/issue numbers it already knows - Reduces hallucination risk on long-context models that may invent incorrect repository names or issue numbers
feat: make repository/issuenumber inputs in tools optional
All checks were successful
check-commitizen.yaml / Check the PR title (pull_request) Successful in 2s
check-formatter.yaml / Checks with formatters (pull_request) Successful in 6s
check-linter.yaml / Checks with linters (pull_request) Successful in 9s
check-prettier.yaml / Check files formatting (pull_request) Successful in 2s
check-syntax.yaml / Checks with static tools (pull_request) Successful in 16s
check-yamllint.yaml / Lint yaml files (pull_request) Successful in 2s
forgejo-agent / LLM Bot response generation (pull_request) Successful in 2s
cda46214fe
chore: fix some styling
All checks were successful
check-formatter.yaml / Checks with formatters (pull_request) Successful in 6s
check-prettier.yaml / Check files formatting (pull_request) Successful in 2s
check-linter.yaml / Checks with linters (pull_request) Successful in 11s
check-yamllint.yaml / Lint yaml files (pull_request) Successful in 3s
check-syntax.yaml / Checks with static tools (pull_request) Successful in 16s
148ce1b34a
davide scheduled this pull request to auto merge when all checks succeed 2026-07-10 23:28:34 +00:00
davide merged commit 590453c564 into main 2026-07-10 23:28:36 +00:00
davide deleted branch feat/optional-tool-params 2026-07-10 23:28:36 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
projects/forgejo-agent!141
No description provided.