Skip to content

perf(commands): stop shipping the bulk subscription record to the model - #177

Open
tiankaima wants to merge 1 commit into
mainfrom
agent/slim-subscription-payloads
Open

tiankaima wants to merge 1 commit into
mainfrom
agent/slim-subscription-payloads

Conversation

@tiankaima

@tiankaima tiankaima commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

Outcome

The current-subscription endpoint returns a complete record for every subscribed section, but each Bot capability uses only a small projection. The full record also exposed a private calendar URL to capabilities that never needed it.

  • Project subscription list, exam, calendar-link, and count results to the fields each capability needs.
  • Keep exam projections deterministic and reuse the existing section projection.
  • Keep the calendar URL only in the calendar-link capability.

Model-facing command payloads are much smaller while user-visible replies remain unchanged, and unrelated capabilities no longer receive the private calendar link.

Refs #178

GET /api/workspace/subscriptions/current answers with the complete jw
record of every subscribed section: dozens of scheduling scalars plus
nested course, category, campus, department and teacher objects, about
3 KB per section. Four read paths loaded that response, used a handful
of fields from it, and then recorded the whole thing as the capability's
model-facing data.

Each site now records a projection of what it actually answers with:

- calendar_link answers with one URL and now carries only that URL.
- subscription list / my_subscribed_sections carry the sections through
  the existing compactSubscriptionSection projection, and no longer leak
  the private iCalendar credential into a list answer.
- exam carries the exams plus the identity of the section each belongs
  to, sorted in display order, instead of all 75 section records.
- the internal subscribed-section probe records its count.

Measured against a 75-section fixture shaped like api/openapi.json
(209,631 char API body), the model-facing tool result drops from
392,178 to 89,327 chars for the subscription list, 392,171 to 28,185
for exams, and 392,279 to 272 for the calendar link. Every reply text
is byte-identical before and after.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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