Skip to content

Offer connections as tools sized to the answering model, shortened to fit - #282

Merged
mehfuzh merged 1 commit into
mainfrom
fix/connections-as-tools-fit
Dec 1, 2026
Merged

mehfuzh merged 1 commit into
mainfrom
fix/connections-as-tools-fit

Conversation

@mehfuzh

@mehfuzh mehfuzh commented Dec 1, 2026

Copy link
Copy Markdown
Member

Problem

With a cloud answering model (glm-5.3), a Linear request still went through the orchestrator instead of the model calling the tools itself:

[connections] 76 tool definition(s) need 97063 chars, over the 4000 this model has room for: left to the planner
  • offered_connection_tools sized the budget from get_max_context_tokens(), the resident model's window, not the answering model's, so it hit the 4000-char floor.
  • Over budget, every connection tool was dropped to the planner, unlike the web, fetch and document tools, which are always offered.

Change

  • Budget from get_response_max_context_tokens(Some(ANSWER_TIER)).
  • When the definitions don't fit, shorten them in steps instead of dropping them:
    • Brief: descriptions cut to 200 chars; optional arguments lose their descriptions.
    • Bare: descriptions cut to 100 chars; only required arguments kept.
  • The planner is left only for a model that calls no tools, or definitions that don't fit even bare.

Testing

  • New unit tests for the shortening pass (cargo test --lib connection_tools).
  • test_client_tools integration tests not run locally (out of disk); left to CI.

… fit

The connection tools' budget came from the resident model's window, not the
answer tier's, so a cloud answering model (glm-5.3) was left 4000 chars and
Linear's 76 tools went to the planner. Size it from the answer tier's model,
and when the definitions still don't fit, shorten them (brief, then bare)
instead of dropping them, so the model decides when to call a connection as
it does for web and document tools.
@mehfuzh
mehfuzh merged commit a6325ce into main Dec 1, 2026
5 checks passed
@mehfuzh
mehfuzh deleted the fix/connections-as-tools-fit branch December 1, 2026 21:20
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