Skip to content

Add opt-in Xquik search and fix context compression - #189

Open
kriptoburak wants to merge 1 commit into
Kocoro-lab:mainfrom
kriptoburak:codex/add-xquik-search-tool
Open

Add opt-in Xquik search and fix context compression#189
kriptoburak wants to merge 1 commit into
Kocoro-lab:mainfrom
kriptoburak:codex/add-xquik-search-tool

Conversation

@kriptoburak

@kriptoburak kriptoburak commented Jun 30, 2026

Copy link
Copy Markdown

Summary

  • Fix context compression so configured primer and recent messages stay intact. Only the middle history is summarized.
  • Version the Temporal change. Existing version 1 histories keep their prior request shape and 20-message behavior.
  • Propagate tenant identity for new summary embeddings. Clamp compression targets to the Python service contract.
  • Add an operator-gated xquik_search tool for paid public X reads.
  • Keep Xquik disabled by default, marked dangerous, and excluded from automatic selection.
  • Validate filters and dates. Normalize the Xquik response contract and sanitize upstream errors.
  • Document opt-in configuration, paid scope, safe limits, and independence wording.

Fixes #190

Xquik Safety

  • Registration requires XQUIK_SEARCH_ENABLED=true.
  • Requests use the fixed https://xquik.com/api/v1/x/tweets/search endpoint.
  • Authentication uses x-api-key. Responses opt into the 2026-04-29 normalized contract.
  • Each call is a paid read. Smaller limits reduce paid scope.
  • A 402 response never creates a checkout or top-up.
  • Raw upstream errors never reach tool output. Returned post content is labeled untrusted.

Validation

  • go test -short -race ./internal/activities ./internal/workflows ./internal/workflows/strategies
  • go build ./...
  • Focused Python tests: 12 passed
  • Full Python suite: 889 passed, 31 failed, 9 errors, 2 skipped
  • Exact base suite: 877 passed, 31 failed, 9 errors, 2 skipped
  • The branch adds 12 passes. The failing and erroring test list matches the base exactly.
  • Targeted Ruff checks passed. The repository-wide optional BrowserTool F401 remains unchanged from the base.
  • Both Compose files parsed with all 4 Xquik variables.
  • git diff --check
  • Rust was unchanged. cargo fmt --check still reports existing formatting drift in unchanged Rust files.

Fix configured middle-history compression and preserve workflow replay behavior.
@kriptoburak
kriptoburak force-pushed the codex/add-xquik-search-tool branch from e96359f to 43cb55b Compare July 30, 2026 06:45
@kriptoburak kriptoburak changed the title Add Xquik search tool Add opt-in Xquik search and fix context compression Jul 30, 2026
@kriptoburak

Copy link
Copy Markdown
Author

I rebuilt this PR on the current main branch and replaced the old head with signed commit 43cb55b.

The branch now fixes #190 as the independent repository issue and adds the Xquik integration as an explicit, disabled-by-default paid tool. Focused Python tests pass 12/12, the race-tested Go packages pass, and go build ./... passes. The full Python suite adds 12 passes with the same baseline failure and fixture-error list.

GitHub CI is waiting for fork-workflow approval and created zero jobs: https://github.com/Kocoro-lab/Shannon/actions/runs/30520600651

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