Skip to content

feat: add experimental agentic ask command - #337

Merged
skvark merged 17 commits into
mainfrom
skvark/experimental-ask-cli
Sep 3, 2026
Merged

feat: add experimental agentic ask command#337
skvark merged 17 commits into
mainfrom
skvark/experimental-ask-cli

Conversation

@skvark

@skvark skvark commented Sep 1, 2026

Copy link
Copy Markdown
Member

Summary

  • add a private transport-neutral Agentic Ask service for POST /ask with strict CLI/MCP/URL response validation, token refresh, a 210-second total deadline, cancellation, bounded response parsing, and safe error/run-ID handling
  • add hidden-by-default githits ask <target> <question> [--source-format cli|url] [--json] and local stdio MCP ask support behind [experimental] tools = true
  • preserve surface-native defaults while allowing original upstream URLs on request: CLI defaults to executable npx githits@latest ... commands, local MCP defaults to backend-provided code_read(...) / docs_read(...) calls, and both accept the URL override
  • render sources deterministically after the agent answer and expose JSON only as the validated response envelope, without usage
  • keep shared auth, terms, cancellation, attribution, timeout, and safe-error behavior; keep Ask absent from default local MCP, hosted/public MCP, @githits/mcp public exports/client, and githits-remote-mcp

Verification

  • URL-focused affected suites: 74 passed; post-review closure suites: 30 passed
  • bun run typecheck, bun run lint, changed-file Biome checks, and git diff --check passed
  • bun run build passed after formatting
  • bun run plugins:generate / plugins:check passed with no generated asset diff
  • built CLI smoke passed all 22 steps; source and built MCP registration smokes passed with stable inventory unchanged and 19 experimental tools
  • authenticated development bun run smoke:mcp passed all 52 steps: default MCP text sources and URL-format JSON were deterministic, had replay IDs, and JSON omitted usage
  • direct authenticated dev CLI URL JSON returned two original GitHub URLs (Ask run 01a0607d-eb9d-7556-ba8e-ac12bb7c89dd)
  • full bun test: 3773 passed; two environment-only failures were the reproducible Windows EBUSY temp cleanup race and the eval harness correctly rejecting managed CODEX_HOME/AGENTS.md
  • source CLI smoke reached and passed the Ask steps, then failed on an unrelated vulnerability-service connection
  • targeted agent-e2e could not run because Codex preflight rejected managed global instructions
  • internal and Opus review loops completed clean after formatting, documentation, and import-order closures

bun run validate:packages cannot complete locally because Bun 1.3.9 panics inside bunup on this Windows workspace path. CI remains authoritative for package validation.

Boundaries

  • no backend, hosted MCP, or remote MCP implementation changes
  • no prompt/model/budget controls and no protocol-55/evaluator-policy changes
  • persisted Ask questions, answers, typed sources, usage events, and child-call correlation remain server-side; no cleanup is performed

Add a private CLI-only Ask transport with strict response validation, bounded requests, authentication refresh, and safe error handling. Wire the opt-in command, actionable source rendering, smoke coverage, documentation, and release metadata without changing the MCP surface.
Stop interactive progress before rendering answers or diagnostics, and reject source argv that does not match the backend's exact githits@latest code-read or docs-read contract.
Preserve terms-acceptance remediation, strip additive backend response fields without exposing usage, sanitize human errors, and include enabled Ask in the curated experimental help surface.
Keep ordinary 403 status mapping when the optional terms-remediation body cannot be read while preserving request cancellation, and align the experimental Ask help entry.
Keep Markdown tab indentation, refresh stale JWTs after the shared terms gate, and classify successful-response stream resets as retryable connection failures without changing cancellation or size-limit behavior.
Add the explicit declaration type required by bunup when the internal service is bundled into the MCP package.
Add the Ask tool only to the opted-in local stdio MCP inventory. Validate backend-provided MCP source calls, render deterministic text and JSON responses, and preserve shared auth, error, attribution, and cancellation behavior.
Allow the experimental CLI and local MCP Ask surfaces to request original upstream URLs while preserving their native source formats by default. Validate and render the selected response shape deterministically without exposing usage.
Expose backend conversation references as thread IDs in the experimental CLI and local MCP surfaces. Validate continuation inputs, preserve replay IDs on failures, and provide compact conditional follow-up guidance.
Direct local MCP agents to resolve ambiguous or noncanonical targets before starting an Ask thread, while preserving the concise continuation guidance.
Restore the compact first MCP description sentence so deferred tool catalogs expose Ask clearly, while retaining thread and target-resolution guidance in subsequent sentences.
Keep the Agentic Ask selection sentence within the deferred catalog limit and lock the sentence content and length in tests.
Keep public Ask guidance focused on supported usage and avoid exposing backend implementation details. Validate malformed invocations before auto-login and map thread continuation failures through the shared error contracts.
Keep the public-only catalog sentence intact while restoring the experimental marker expected across the local MCP tool suite.
The local MCP policy and inventory already identify experimental tools. Keep Ask guidance focused on usage and test the registration boundary instead of requiring duplicated catalog prose.
Consume the thread-named Ask request, response, and error header directly. Remove the now-unnecessary conversation-to-thread response transforms and update the affected contract fixtures.
@skvark
skvark marked this pull request as ready for review September 3, 2026 12:35
@skvark
skvark merged commit eca38f3 into main Sep 3, 2026
10 checks passed
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