Filter action-based links from MCP work package responses#24307
Filter action-based links from MCP work package responses#24307NobodysNightmare wants to merge 2 commits into
Conversation
|
Caution The provided work package version does not match the core version Details:
Please make sure that:
|
| previewMarkup | ||
| timeEntries | ||
| showCosts | ||
| addFileLink |
There was a problem hiding this comment.
This is a pretty manual approach to filtering links...
I am wondering whether this is acceptable, as the topic of filtering these is kind of a micro optimization for MCP alone or whether it would be worth to invest more into the architecture here.
For example we could classify the links at definition time (i.e. in the representer class) and then reflect based on that classification whether we should filter them or not. On the plus side, this would allow to define one filter that works across different resources. On the minus side, this is vastly more complex and cross-cutting, while only solving a "local" MCP problem.
Thoughts and opinions on that?
|
Warning Flaky specs
🤖 Ask Copilot to investigateCopy the prompt below into a new comment on this PR to delegate the investigation to GitHub Copilot. It will look into the flakiness and open a separate pull request with you as reviewer. |
These links don't offer any helpful context for understanding the work package better, but they increase the size of the response significantly. In our HAL/Hateoas-based APIv3 they are used to communicate what can happen to a resource. However, MCP clients will usually try to do what users ask them to do and then see if that succeeds, rather than assuming that a certain action is not possible because a corresponding link is missing. Thus those "action links" are mostly dead weight in the response.
504c529 to
7c03f82
Compare
Essentially all the recursing into arrays and hashes would look the same across most filters. The interesting part so far is what you do to the hashes.
7c03f82 to
890fbdc
Compare
|
Warning Flaky specs
🤖 Ask Copilot to investigateCopy the prompt below into a new comment on this PR to delegate the investigation to GitHub Copilot. It will look into the flakiness and open a separate pull request with you as reviewer. |
These links don't offer any helpful context for understanding the work package better, but they increase the size of the response significantly.
In our HAL/Hateoas-based APIv3 they are used to communicate what can happen to a resource. However, MCP clients will usually try to do what users ask them to do and then see if that succeeds, rather than assuming that a certain action is not possible because a corresponding link is missing. Thus those "action links" are mostly dead weight in the response.
Ticket
https://community.openproject.org/wp/AI-45
Impact
I am trying to gauge the impact of this change (including the upstream change of filtering HTML).
In our
search_work_packagetest case that returns two work packages, the response size ondevis ~22kB, while the size on this PR is just shy of 12kB. This means a reduction in response size of about 45%.I also did another test with one of my local test work packages. It might over-use wiki page links a bit, so also take that with a grain of salt, but here the reduction is more impactful, shrinking the response from 28.48 kiB to 4.22 kiB, so a reduction by 85%.
For reference, this is the work package: