Skip to content

Fix: Update twdesk toolsets for desksdkgo v1 + add sparse fieldset support#329

Merged
ready4god2513 merged 2 commits into
mainfrom
desk-sparse-fields
May 15, 2026
Merged

Fix: Update twdesk toolsets for desksdkgo v1 + add sparse fieldset support#329
ready4god2513 merged 2 commits into
mainfrom
desk-sparse-fields

Conversation

@ready4god2513
Copy link
Copy Markdown
Contributor

Patches all twdesk tools to compile against the v1 desksdkgo API, which introduced two breaking changes: Get methods now require a url.Values parameter, and all model string/bool/int fields changed to pointer types.

Adds sparse fieldset support throughout every read operation so the LLM can request only the fields it needs and avoid bloating token counts:

  • meta.go: add strPtr/intPtr/boolPtr helpers, sparseFieldsSchema(), getParams() (builds url.Values with includes=all + optional fields), and wire fields into paginationOptions() and setPagination() so every list operation automatically honours the parameter
  • All Get tools: accept an optional "fields" array and pass it to the SDK via getParams(); handlers that previously returned text summaries now return full JSON so sparse fields are meaningful
  • All List/Search tools: "fields" flows through setPagination to the query string
  • files.go, messages.go: fix model field assignments to use pointer types

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Testing

  • Tests pass locally (go test -v ./...)
  • Added/updated tests for new functionality

Checklist

  • Code follows project style guidelines
  • Self-reviewed the code
  • Added necessary documentation
  • No new warnings or errors

…pport

Patches all twdesk tools to compile against the v1 desksdkgo API, which
introduced two breaking changes: Get methods now require a url.Values
parameter, and all model string/bool/int fields changed to pointer types.

Adds sparse fieldset support throughout every read operation so the LLM
can request only the fields it needs and avoid bloating token counts:

- meta.go: add strPtr/intPtr/boolPtr helpers, sparseFieldsSchema(),
  getParams() (builds url.Values with includes=all + optional fields),
  and wire fields into paginationOptions() and setPagination() so every
  list operation automatically honours the parameter
- All Get tools: accept an optional "fields" array and pass it to the
  SDK via getParams(); handlers that previously returned text summaries
  now return full JSON so sparse fields are meaningful
- All List/Search tools: "fields" flows through setPagination to the
  query string
- files.go, messages.go: fix model field assignments to use pointer types
@ready4god2513 ready4god2513 requested a review from a team as a code owner May 15, 2026 15:55
@ready4god2513 ready4god2513 requested a review from rafaeljusto May 15, 2026 16:12
@rafaeljusto
Copy link
Copy Markdown
Contributor

Instead of giving the full sparse field options to the LLM, maybe keep a verbose flag that enables or disables the entire entity? Like, when verbose is disable we could return the ticket id and title only.

@ready4god2513
Copy link
Copy Markdown
Contributor Author

This doesn't fix (or make worse) the openai strict mode. I am working on a PR to fix that for Desk right now.

@ready4god2513 ready4god2513 merged commit a0341b2 into main May 15, 2026
3 checks passed
@ready4god2513 ready4god2513 deleted the desk-sparse-fields branch May 15, 2026 16:35
@rafaeljusto
Copy link
Copy Markdown
Contributor

Instead of giving the full sparse field options to the LLM, maybe keep a verbose flag that enables or disables the entire entity? Like, when verbose is disable we could return the ticket id and title only.

We discussed this, and will go ahead with these changes, monitoring how the LLM behaves with the sparse field options.

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.

2 participants