fix(memory): gitea_memory_brain_sync advertises action "format" but rejects it (and defaults to it) #22

Closed
opened 2026-10-24 00:58:38 +00:00 by dsh · 1 comment
Owner

Symptom

gitea_memory_brain_sync fails with Unknown memory brain action: format. format is both an allowed enum value in the tool definition and the handler's default action, so a parameterless call fails too.

Repro

gitea_memory_brain_sync {action:"format", owner:"dsh-plugins", repo:"dsh-gitea", summary:"QA probe"}
→ gitea_memory_brain_sync failed: Unknown memory brain action: format

release_fact and pr_fact work:

gitea_memory_brain_sync {action:"release_fact", repo:"dsh-gitea", tag:"v0.7.40-dsh.7", version:"0.7.40-dsh.7"}
→ Memory Brain Sync: Fact prepared for release in project dsh-gitea.

Observed vs expected

  • Observed: an advertised action errors, and the default path is the broken action.
  • Expected: format returns a formatted, unpersisted memory fact (like release_fact/pr_fact but auto-detected), or the enum/default is corrected and documented.

Root cause

lib/memory-brain-sync.js:

const action = args.action || 'format'
...
if (action === 'release_fact') { ... }
if (action === 'pr_fact') { ... }
if (action === 'remember' || action === 'sync' || args.sync === true) { ... }
return { ok: false, error: `Unknown memory brain action: ${action}` }

There is no format branch, while the tool schema exposes format.

Proposed fix

Implement format as the non-persisting auto-detection path (release vs PR), or drop it from the schema and make the default release_fact/preflight-style read action. Add a handler test for every enum value plus a parameterless call.

Acceptance: each action in the schema either succeeds or is removed from the schema; the default call does not error.

Duplicate check

Searched issues for memory (state all) → no existing issue.

Layer

dsh-gitea plugin/tool.

## Symptom `gitea_memory_brain_sync` fails with `Unknown memory brain action: format`. `format` is both an allowed enum value in the tool definition and the handler's default action, so a parameterless call fails too. ## Repro ``` gitea_memory_brain_sync {action:"format", owner:"dsh-plugins", repo:"dsh-gitea", summary:"QA probe"} → gitea_memory_brain_sync failed: Unknown memory brain action: format ``` `release_fact` and `pr_fact` work: ``` gitea_memory_brain_sync {action:"release_fact", repo:"dsh-gitea", tag:"v0.7.40-dsh.7", version:"0.7.40-dsh.7"} → Memory Brain Sync: Fact prepared for release in project dsh-gitea. ``` ## Observed vs expected - Observed: an advertised action errors, and the default path is the broken action. - Expected: `format` returns a formatted, unpersisted memory fact (like `release_fact`/`pr_fact` but auto-detected), or the enum/default is corrected and documented. ## Root cause `lib/memory-brain-sync.js`: ```js const action = args.action || 'format' ... if (action === 'release_fact') { ... } if (action === 'pr_fact') { ... } if (action === 'remember' || action === 'sync' || args.sync === true) { ... } return { ok: false, error: `Unknown memory brain action: ${action}` } ``` There is no `format` branch, while the tool schema exposes `format`. ## Proposed fix Implement `format` as the non-persisting auto-detection path (release vs PR), or drop it from the schema and make the default `release_fact`/`preflight`-style read action. Add a handler test for every enum value plus a parameterless call. Acceptance: each action in the schema either succeeds or is removed from the schema; the default call does not error. ## Duplicate check Searched issues for `memory` (state all) → no existing issue. ## Layer dsh-gitea plugin/tool.
Author
Owner

Fixed in 281eade (PR #40).

action: "format" now returns an auto-detected, non-persisted memory fact (persisted:false, synced:false), and the parameterless default no longer errors. release_fact, pr_fact and remember are unchanged.

Live: gitea_memory_brain_sync {action:"format", tag:"v0.8.0", version:"0.8.0"} → Memory Brain Sync: Fact prepared for release in project dsh-gitea.

Tests: test/qa-defaults.test.mjs.

Fixed in `281eade` (PR #40). `action: "format"` now returns an auto-detected, non-persisted memory fact (`persisted:false, synced:false`), and the parameterless default no longer errors. `release_fact`, `pr_fact` and `remember` are unchanged. Live: `gitea_memory_brain_sync {action:"format", tag:"v0.8.0", version:"0.8.0"}` → `Memory Brain Sync: Fact prepared for release in project dsh-gitea.` Tests: `test/qa-defaults.test.mjs`.
dsh closed this issue 2026-10-24 01:16:40 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
dsh-plugins/dsh-gitea#22
No description provided.