Skip to content

Summaries through OpenAI and Anthropic, with an editable prompt - #817

Merged
thesiti92 merged 10 commits into
mainfrom
feat/summary-providers
Oct 2, 2026
Merged

thesiti92 merged 10 commits into
mainfrom
feat/summary-providers

Conversation

@thesiti92

@thesiti92 thesiti92 commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Closes #788. Bundles diffr 0.1.9 (devdotfast/diffr#60, #62 and #65).

Settings → AI summaries

  • Provider: Gemini, OpenAI (also any OpenAI-compatible server) or Anthropic. Switching resets the model to that provider's default.
  • Endpoint URL: optional. Leave it empty for the provider's own API.
  • Prompt: editable, showing whether it is the default or customized, with "Reset to default". The description says diffr asks for structured output where the provider supports it.
  • Test setup: uses the draft provider, endpoint and prompt, so you can try them before saving.
  • Keys: switching providers clears a key saved for the previous one, so a key is never sent to another vendor. Credentials are checked against the chosen provider's environment variable.

No duplicated defaults. Provider ids, titles, default models, endpoints, key variables and the keyless rule all come from diffr config schema. A default changed in diffr, or a provider added there, needs no change here.

Server

  • Reads the default prompt from diffr config schema.
  • Writes only settings that changed. diffr now drops values that equal their defaults, so resetting the prompt removes it from the config file.

Verified

  • Unit tests (19) and browser tests (10) pass.
  • Against a local diffr build with the same code:
    • switching provider clears the old key and keeps the config file sparse;
    • resetting the prompt removes it from the file;
    • Test setup works through a keyless OpenAI-compatible server;
    • Test setup works live against Anthropic (claude-sonnet-5-5).
  • Checked in an isolated dev Desktop; that check caught two UI fixes.
  • test:integration:diffr (16) passes against the pinned 0.1.9 release.

…table prompt

Switching providers clears a key saved for the previous one, credentials are checked against the chosen provider, and the default prompt and its source link come from diffr's schema.

Agent-Session: 459ae7ec-7302-42c5-b473-4e315a7e4e19
Agent-Session: 203ee435-a867-494c-bb56-ddde9edf962e
Agent-Session: ff765ffc-78bb-499b-9e86-9f7a942edbf0
Agent-Session: 78694b58-9718-40bf-a6b8-661e21afe339
Agent-Session: a9cd3da4-c06c-4d2b-b8e8-e71439cee705
Agent-Session: 0e24d827-3a5e-4ed7-aa02-bbda8d39a5e0
Agent-Session: 01a0f3f9-35d2-7bd1-a229-ec501a87447e
The prompt shows whether it is the default, links to the default in diffr's source, and can be reset. Choice moves to its own file so both settings screens share it.

Agent-Session: 459ae7ec-7302-42c5-b473-4e315a7e4e19
Agent-Session: 203ee435-a867-494c-bb56-ddde9edf962e
Agent-Session: ff765ffc-78bb-499b-9e86-9f7a942edbf0
Agent-Session: 78694b58-9718-40bf-a6b8-661e21afe339
Agent-Session: a9cd3da4-c06c-4d2b-b8e8-e71439cee705
Agent-Session: 0e24d827-3a5e-4ed7-aa02-bbda8d39a5e0
Agent-Session: 01a0f3f9-35d2-7bd1-a229-ec501a87447e
…nst diffr

Agent-Session: 459ae7ec-7302-42c5-b473-4e315a7e4e19
Agent-Session: 203ee435-a867-494c-bb56-ddde9edf962e
Agent-Session: ff765ffc-78bb-499b-9e86-9f7a942edbf0
Agent-Session: 78694b58-9718-40bf-a6b8-661e21afe339
Agent-Session: a9cd3da4-c06c-4d2b-b8e8-e71439cee705
Agent-Session: 0e24d827-3a5e-4ed7-aa02-bbda8d39a5e0
Agent-Session: 01a0f3f9-35d2-7bd1-a229-ec501a87447e
Agent-Session: 459ae7ec-7302-42c5-b473-4e315a7e4e19
Agent-Session: 203ee435-a867-494c-bb56-ddde9edf962e
Agent-Session: ff765ffc-78bb-499b-9e86-9f7a942edbf0
Agent-Session: 78694b58-9718-40bf-a6b8-661e21afe339
Agent-Session: a9cd3da4-c06c-4d2b-b8e8-e71439cee705
Agent-Session: 0e24d827-3a5e-4ed7-aa02-bbda8d39a5e0
Agent-Session: 01a0f3f9-35d2-7bd1-a229-ec501a87447e
…schema

A switch clears the saved key before writing the new provider, endpoint and key, so a failure part way cannot send a key to another vendor. A new endpoint counts as a new destination, switching provider clears a custom endpoint, and Test setup never reuses a key across either. Settings still read when diffr cannot describe its schema, a blank prompt leaves diffr's default in place, and a saved prompt is compared as written.

Agent-Session: 459ae7ec-7302-42c5-b473-4e315a7e4e19
Agent-Session: 203ee435-a867-494c-bb56-ddde9edf962e
Agent-Session: ff765ffc-78bb-499b-9e86-9f7a942edbf0
Agent-Session: 78694b58-9718-40bf-a6b8-661e21afe339
Agent-Session: a9cd3da4-c06c-4d2b-b8e8-e71439cee705
Agent-Session: 0e24d827-3a5e-4ed7-aa02-bbda8d39a5e0
Agent-Session: 01a0f3f9-35d2-7bd1-a229-ec501a87447e
Agent-Session: 459ae7ec-7302-42c5-b473-4e315a7e4e19
Agent-Session: 203ee435-a867-494c-bb56-ddde9edf962e
Agent-Session: a9cd3da4-c06c-4d2b-b8e8-e71439cee705
Agent-Session: 0e24d827-3a5e-4ed7-aa02-bbda8d39a5e0
Agent-Session: 879f8dc8-4a2e-4c1d-a221-935df47f9854
Agent-Session: 01a0f3f9-35d2-7bd1-a229-ec501a87447e
Provider ids, titles, default models, endpoints, key variables and the keyless rule all come from diffr config schema, so a default changed in diffr needs no change here. Test setup lets diffr derive the draft provider's details instead of copying the saved provider's.

Agent-Session: 459ae7ec-7302-42c5-b473-4e315a7e4e19
Agent-Session: 203ee435-a867-494c-bb56-ddde9edf962e
Agent-Session: 0e24d827-3a5e-4ed7-aa02-bbda8d39a5e0
Agent-Session: 879f8dc8-4a2e-4c1d-a221-935df47f9854
Agent-Session: 01a0f3f9-35d2-7bd1-a229-ec501a87447e
@thesiti92
thesiti92 force-pushed the feat/summary-providers branch from 1602c3f to 3483ab5 Compare October 1, 2026 14:47
0.1.9 adds OpenAI and Anthropic summaries, sparse config files, an editable prompt and provider defaults declared in plugin.toml.

Agent-Session: 203ee435-a867-494c-bb56-ddde9edf962e
Agent-Session: 879f8dc8-4a2e-4c1d-a221-935df47f9854
Agent-Session: 459ae7ec-7302-42c5-b473-4e315a7e4e19
Agent-Session: 01a0f84f-dd30-7a41-b2fe-0d7af3946366
Agent-Session: 408b4035-faad-4e97-8a45-c45f69a2b596
…ut is used

The default prompt is already on screen, so the GitHub link is dropped. The description now says diffr asks for structured output where the provider supports it.

Agent-Session: 203ee435-a867-494c-bb56-ddde9edf962e
Agent-Session: 879f8dc8-4a2e-4c1d-a221-935df47f9854
Agent-Session: 459ae7ec-7302-42c5-b473-4e315a7e4e19
Agent-Session: 01a0f84f-dd30-7a41-b2fe-0d7af3946366
Agent-Session: 408b4035-faad-4e97-8a45-c45f69a2b596
@thesiti92
thesiti92 marked this pull request as ready for review October 1, 2026 18:00
diffr will clear a provider's endpoint, key and model when the provider changes. Saving now rereads diffr's values after each write and queues a custom endpoint again on a provider switch, so one kept across the switch is not skipped and lost. With diffr 0.1.9 the extra write is a no-op.

Agent-Session: 203ee435-a867-494c-bb56-ddde9edf962e
Agent-Session: 879f8dc8-4a2e-4c1d-a221-935df47f9854
Agent-Session: 459ae7ec-7302-42c5-b473-4e315a7e4e19
Agent-Session: 01a0f84f-dd30-7a41-b2fe-0d7af3946366
Agent-Session: 01a0f894-9661-79c0-a6c4-71002d15105c
Agent-Session: 00102a68-dcd0-4748-a95e-fc417ddbb706
@thesiti92
thesiti92 merged commit 2c671f1 into main Oct 2, 2026
1 check passed
@thesiti92
thesiti92 deleted the feat/summary-providers branch October 2, 2026 16:14
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.

Support multiple vendors for AI source-file summaries

2 participants