Skip to content

compactThread returns 409 for acp-omp although the provider-acp bridge already implements /compact #2290

Closed

Description

@bradhallett

1. Summary

Asking bb to compact an acp-omp (omp) thread is rejected with
409 Provider "acp-omp" does not support manual context compaction, so the
composer hides/disables the /compact affordance and plugins calling the
compactThread RPC fail. The rejection happens in the server's capability
gate, before the provider-acp bridge is ever consulted — and that bridge
already implements manual compaction end-to-end by sending the agent's own
/compact command as a session/prompt maintenance turn. Only the static
per-agent capability declaration is wrong: acp-omp still carries the ACP
tier default (supportsManualCompaction: false) while acp-opencode
overrides the same flag to true.

2. Versions and environment

  • bb desktop app (audited install), audit window 2026-08-20 → 2026-08-22.
  • Source-level verification against main at fff3ae8 (all source links below use that commit).
  • Provider: acp-omp via the first-party provider-acp plugin bridge, which
    spawns omp acp per thread. OMP nightly build (oh-my-pi,
    github.com/can1357/oh-my-pi).
  • OS: macOS (arm64). No remote/worktree/custom-port specifics; standard data
    dir.
  • Investigation: bb thread thr_cz6spq5br5 (2026-08-22 integration audit,
    post-mortem Issue 4a).

3. Steps to reproduce

  1. Install the omp CLI and sign in (omp login), so bb lists the omp
    provider (acp-omp).
  2. Start a thread on the omp provider and run a few turns so the context
    grows.
  3. Trigger manual compaction either from the composer's /compact builtin
    or via the RPC surface: POST /api/v1/threads/<threadId>/compact (this
    is what the community context-compact plugin calls).
  4. Observe the failure. Smallest repro is the HTTP call alone on an idle
    omp thread; no turn content matters.

Negative space: the same call succeeds on acp-opencode threads (the one
ACP agent whose declaration overrides the flag), and on codex, pi, and
claude-code. Compacting an active thread correctly 409s on every
provider with the status message — the defect is specifically the
capability answer for acp-omp.

4. Expected vs actual

Actual (plugin log line, 2026-08-22 07:06:10 UTC, audit window):

[plugin:context-compact] rpc compactThread failed: HTTP 409: Provider "acp-omp" does not support manual context compaction

Direct HTTP repro answers the same body:

{"error":{"code":"invalid_request","message":"Provider \"acp-omp\" does not support manual context compaction"}}

Expected: 200, one turn dispatched carrying the standalone builtin
/compact command input. The provider-acp bridge recognizes that input and
runs the agent's own /compact command as a provider-local maintenance
prompt (session/prompt with text /compact), then reports it through the
acp/compaction/started / acp/compaction/completed envelopes, which the
bridge's delta translator emits as a contextCompaction turn and — only on
a completed one — a thread/compacted event. That entire path exists and is
tested today; it is simply unreachable for acp-omp.

5. Evidence

  • The server gate that produces the 409:
    apps/server/src/routes/threads/actions.ts#L140-L146
    — compactThreadContext throws before any bridge traffic when
    providerRegistry.supportsManualCompaction(thread.providerId) is false.
  • How the registry answers for acp-omp: plugin registrations win over the
    dynamic tier —
    services/providers/provider-registry.ts#L453-L464.
  • The wrong declaration: ACP_BASE_CAPABILITIES defaults
    supportsManualCompaction: false
    (plugins/provider-acp/server.ts#L21);
    the acp-omp entry spreads it unmodified
    (L137),
    while acp-opencode overrides supportsManualCompaction: true
    (L112-L115).
    The bridge's own doc comment states the intended contract: the affordance
    is gated by "the provider declaration or custom-agent config"
    (bridge.ts#L2088-L2095).
  • The bridge implementation that never gets consulted:
    startCompaction sends session/prompt with text /compact
    (bridge.ts#L2096-L2121);
    the dispatch recognizes bb's standalone builtin /compact mention
    (L2535-L2538);
    the translator emits thread/compacted only for completed compactions
    (delta-translation.ts#L747-L769);
    covered by bridge.test.ts ("runs the builtin /compact command as
    compaction, not as a prompt").
  • omp-side behavior: omp executes builtin slash commands from prompt text
    (its ACP mode received and ran /compact-class commands during the audit
    window; OMP session transcripts show compaction running). The bridge also
    fails the turn legibly rather than pretending success when an agent lacks
    the command, so flipping the declaration for omp does not weaken the
    per-agent honesty for agents that genuinely lack /compact
    (cursor/grok/hermes stay false).
  • The 409 log line and the audit method are in the investigation report
    (bb thread thr_cz6spq5br5, post-mortem "Issue 4 — Capability gaps", item 1).

6. What you ruled out

  • Not a bridge gap: startCompaction and its envelopes/translator/tests all
    exist at the base commit; the 409 is thrown server-side before any bridge
    process sees the request.
  • Not a duplicate of pi provider: no way to manually compact a thread's context #1103 (closed) or Add manual context compaction across providers #1152 (merged): Add manual context compaction across providers #1152 added manual
    compaction but explicitly excluded ACP providers; that exclusion predates
    the bridge's /compact maintenance-prompt flow, so its premise no longer
    holds for omp. This issue supplies the new evidence (bridge already
    implements compaction; omp accepts /compact).
  • Not an omp-side protocol gap: ACP has no compaction method and omp
    advertises no compaction config option, but bb's bridge deliberately does
    not need one — it routes through session/prompt, per its own doc comment.
  • Still present at main @ fff3ae8: the acp-omp declaration still
    spreads the false default (verified by reading the source, not by a live
    repro on main).
  • Not data loss or corruption: the request is refused outright; no partial
    compaction occurs.

7. Suggested priority and effort

Low priority, small effort. Every omp-thread user loses the manual
context-shrink lever on long threads (the affordance is gated off), with no
UI workaround, but nothing is lost or corrupted. Fix is a one-line
per-agent capability override in plugins/provider-acp/server.ts matching
the existing acp-opencode pattern, plus test-table/test-case updates
(the public compaction suite and the first-party capability table).

AGENT GENERATED

Activity

  1. bradhallett commented on Aug 22, 2026

    @bradhallett
    ContributorAuthor

    Live production evidence that the bridge compaction path works end-to-end for acp-omp — gathered today (2026-08-22) on a real thread, independent of this PR's tests.

    A local auto-compaction plugin (context-compact) queues /compact for busy threads instead of calling the direct RPC. On thread thr_4tm7g4ie78 (provider acp-omp, OMP 17.4.1) the queued command drained at the turn boundary and executed a real compaction through the provider:

    14:31:39Z  plugin log: auto-compact thr_4tm7g4ie78: 73111 tok (7%) → queue
               (idle acp-omp threads in the same sweep: "provider acp-omp has no
                manual compaction; skipping its threads" — the 409 gate)
    14:36:50Z  turn/completed (prior turn ends)
    14:36:50Z  client/turn/requested: "/compact" (builtin command mention)
    14:36:50Z  turn/started → item/started contextCompaction → turn/input/accepted
    14:38:17Z  thread/compacted → turn/completed
    

    Sequence numbers on the thread's event log: 19648 (prior turn/completed), 19649–19652 (the /compact turn: requested/started/contextCompaction/input-accepted), 19656 (thread/compacted), 19657 (turn/completed). Provider session id 01a027f5-2537-7000-98be-c1612765f2f8 is stable across all four.

    Two conclusions:

    1. The turn-input compaction path already works for acp-omp in production — the same path this PR's new public-route test exercises (createStandaloneBuiltinCompactCommandInput → bridge → session/prompt "/compact"). The compaction above completed successfully at 14:38:17Z.
    2. The 409 is purely the declaration-level gate (supportsManualCompaction: false in ACP_BASE_CAPABILITIES) blocking the idle/direct compactThread RPC. Busy threads are servable today only because the queue path never consults that gate.

    So the declaration flip in this PR doesn't enable an untested path — it un-gates the direct RPC onto a path production already exercises successfully.

    AGENT GENERATED

  2. added theissue type on Aug 23, 2026
  3. added
    providers
    provider-acp
    omp
    on Aug 23, 2026
  4. SawyerHood commented on Aug 24, 2026

    @SawyerHood
    Collaborator

    ---Auto-Generated---

    Reproduction & root-cause report: https://get-bb.github.io/reports/issues/2290.html

    • Verdict: REPRODUCED · root-cause confidence: high
    • Root cause (short): The acp-omp entry in plugins/provider-acp/src/known-agents.ts omits supportsManualCompaction (opencode sets it), so the server's compactThreadContext gate 409s and the composer hides /compact before the bridge's working /compact maintenance-prompt path is ever reached; additionally, omp answers end_turn even when its /compact fails ("Nothing to compact"), so lifting the gate alone yields a false thread/compacted.
    • Linked PR review: fix(provider-acp): declare manual compaction support for omp #2293 → REQUEST CHANGES — Unmergeable: it patches ACP_PROVIDERS in plugins/provider-acp/server.ts, which Provider plugins: one API for Codex, Claude Code, pi, and ACP agents #2325 (e42a4ef) removed; the property must move to the acp-omp entry in plugins/provider-acp/src/known-agents.ts. Also, un-gating exposes a false thread/compacted + 'Context compacted' banner when omp replies 'Compactio
    • Proposed fix: (1) Add supportsManualCompaction: true to the acp-omp entry in plugins/provider-acp/src/known-agents.ts (verified: PR tests + repro pass, typecheck green, live POST returns 200; no protocol bump needed since the flag is server-internal); update the first-party capability table test and add the acp-omp 200-path case to public-thread-compaction.test.ts. (2) In packages/provider-bridge-acp startCompaction, detect omp's agent message 'Compaction failed: …' during the compaction prompt and finish with status failed — or treat 'Nothing to compact (session too small)' / 'Already compacted' as a s…
    • Caveats: Live repro used omp 16.3.10 (issue cites OMP 17.4.1 nightly) on a 2-message session, so the successful-compaction path was not observed live; only the small-session false-positive was. The issue comment's production success on a 73k-token thread is unverifiable from here. The second thread tell in step 06 did not append a provider turn, so both compaction attempts hit the same small session. The…

    The report is self-contained: copy-paste repro steps with the test or script inline, expected vs actual output, screenshots where the bug is visual, and code permalinks at the base commit. It was independently re-executed by a second agent (see its Verification section).

    AGENT GENERATED: by Claude Code

  5. added
    confirmed-repro
    on Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-reproompprovider-acpproviders

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions