Skip to content

refactor!: remove interceptions API, request logs view, and associated code#26213

Open
dannykopping wants to merge 2 commits into
mainfrom
danny/remove-interceptions-and-request-logs
Open

refactor!: remove interceptions API, request logs view, and associated code#26213
dannykopping wants to merge 2 commits into
mainfrom
danny/remove-interceptions-and-request-logs

Conversation

@dannykopping

@dannykopping dannykopping commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Removes the deprecated /api/v2/aibridge/interceptions endpoint and the Request Logs frontend page, both replaced by the session-based view.

Closes https://linear.app/codercom/issue/AIGOV-266
Closes https://linear.app/codercom/issue/AIGOV-324

Changes

Backend

  • Remove GET /api/v2/aibridge/interceptions HTTP handler and route
  • Remove SDK types and client method (AIBridgeInterception, AIBridgeTokenUsage, AIBridgeUserPrompt, AIBridgeToolUsage, AIBridgeListInterceptionsResponse, AIBridgeListInterceptionsFilter)
  • Remove SQL queries CountAIBridgeInterceptions and ListAIBridgeInterceptions
  • Remove searchquery.AIBridgeInterceptions parser
  • Remove dbauthz wrappers, in-memory implementations, metrics, and mocks for the interceptions list queries
  • Remove the coder aibridge interceptions list CLI command and golden files
  • Regenerate API docs, swagger, mocks, and metrics

The /models, /clients, and /sessions endpoints stay; the sessions list page still consumes all three.

Frontend

  • Delete the entire RequestLogsPage/ directory (page, view, row, filter, stories, tests)
  • Remove the /aibridge/request-logs route and its lazy import
  • Remove the getAIBridgeInterceptions API method, paginatedInterceptions query, and mock interception entities
  • git mv the shared filter and icon components used by the sessions pages:
    • RequestLogsPage/RequestLogsFilter/{Client,Model,Provider}Filter.tsxAIBridgePage/filters/
    • RequestLogsPage/icons/AIBridge{Client,Model,Provider}Icon.tsxAIBridgePage/icons/
  • Drop the getProviderIconName hack and the duplicate anthropic-neue icon case now that the FIXME no longer applies

Commits

  1. refactor: remove interceptions API and request logs view — the bulk removal, with explicit renames for the shared filter/icon files.
  2. refactor(site/src/pages/AIBridgePage): drop getProviderIconName hack — cleanup of the FIXME that depended on RequestLogsPage existing.

Note

Generated by Coder Agents on behalf of @dannykopping

@linear-code

linear-code Bot commented Jun 10, 2026

Copy link
Copy Markdown

AIGOV-266

AIGOV-324

@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown

Docs preview

📖 View docs preview for docs/ai-coder/ai-gateway/monitoring.md

@dannykopping dannykopping force-pushed the danny/remove-interceptions-and-request-logs branch 2 times, most recently from eaa4780 to 527c0ca Compare June 10, 2026 18:41

const maxInterceptionsLimit = 1000

func (r *RootCmd) aibridge() *serpent.Command {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't query sessions fromt the CLI yet. We can add this back if/when we do, or we add some other feature to the CLI for AI Gateway.

@dannykopping dannykopping force-pushed the danny/remove-interceptions-and-request-logs branch 2 times, most recently from 58082df to 52b1854 Compare June 10, 2026 19:05
@dannykopping dannykopping marked this pull request as ready for review June 11, 2026 06:26
@coder-tasks

coder-tasks Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Documentation Check

Updates Needed

  • docs/reference/cli/aibridge.md - Should be deleted; documents the removed coder aibridge CLI command (generated content, not updated by make gen)
  • docs/reference/cli/aibridge_interceptions.md - Should be deleted; documents the removed coder aibridge interceptions subcommand
  • docs/reference/cli/aibridge_interceptions_list.md - Should be deleted; documents the removed coder aibridge interceptions list subcommand
  • docs/manifest.json - Remove entries for reference/cli/aibridge.md, reference/cli/aibridge_interceptions.md, and reference/cli/aibridge_interceptions_list.md (lines 1641-1651)
  • docs/ai-coder/ai-gateway/monitoring.md - The "CLI" subsection under "Data Export" (lines ~110-126) references coder aibridge interceptions list, which no longer exists. Remove or replace with the sessions-based alternative

Automated review via Coder Agents

Remove the deprecated /api/v2/aibridge/interceptions endpoint, the
Request Logs frontend page, and all supporting code. The sessions-based
view replaces them. Closes AIGOV-266 and AIGOV-324.

Backend:
- /interceptions HTTP handler and CLI command
- SDK types and client methods for interceptions
- Interceptions list/count SQL queries and search query parser
- dbauthz wrappers and in-memory query implementations

Frontend:
- RequestLogsPage and its row, filter, and view components
- Router route and lazy import for /aibridge/request-logs
- API client method and query function for interceptions
- Mock interception entities

The /models and /clients endpoints stay because the sessions list page
filter menus still need them. The shared filter and icon components
move from RequestLogsPage to AIBridgePage/filters and
AIBridgePage/icons so the sessions pages keep working.
The getProviderIconName wrapper existed to remap "anthropic" to
"anthropic-neue" so RequestLogsPage rendered the correct icon. With
that page removed, the wrapper, the FIXME comment, and the duplicate
"anthropic-neue" icon case are no longer needed. Call sites now pass
the provider directly.
@dannykopping dannykopping force-pushed the danny/remove-interceptions-and-request-logs branch from 52b1854 to eb43282 Compare June 11, 2026 06:42

@dannykopping dannykopping left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Self-review: ✅

@matifali matifali left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we mark this PR as BREAKING with using reafctor!:. Otherwise, it looks good to me.

@dannykopping

Copy link
Copy Markdown
Contributor Author

Should we mark this PR as BREAKING with using reafctor!:. Otherwise, it looks good to me.

Good call; I thought I'd marked these all deprecated but I hadn't.

@dannykopping dannykopping changed the title refactor: remove interceptions API, request logs view, and associated code refactor!: remove interceptions API, request logs view, and associated code Jun 11, 2026
@github-actions github-actions Bot added the release/breaking This label is applied to PRs to detect breaking changes as part of the release process label Jun 11, 2026

matifali commented Jun 11, 2026

Copy link
Copy Markdown
Member

Oh, in that case WDYT about marking these as deprecated in this release, showing warnings, and removing them in the next?
The PR body does say that "removed the deprecated …." so it's fine if it's already deprecated.

Copy link
Copy Markdown
Member

Not a blocker at all. Just an observation and I would leave the decision to you. Thanks

@dannykopping

dannykopping commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

Oh, in that case WDYT about marking these as deprecated in this release, showing warnings, and removing them in the next? The PR body does say that "removed the deprecated …." so it's fine if it's already deprecated.

The web UI is already hidden. I think it's safe to get rid of the APIs as well. I doubt anybody is using them; they're not useful. And if anyone complains we'll advise them to move over to the new APIs.

@evgeniy-scherbina evgeniy-scherbina left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release/breaking This label is applied to PRs to detect breaking changes as part of the release process

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants