Skip to content

fix(search): validate Grok completion and preserve native CLI login - #4

Open
shookya wants to merge 3 commits into
Walvez:mainfrom
shookya:fix/search-contract
Open

shookya wants to merge 3 commits into
Walvez:mainfrom
shookya:fix/search-contract

Conversation

@shookya

@shookya shookya commented Oct 2, 2026

Copy link
Copy Markdown

Why

Public search could report cancelled or malformed Grok output as success, and synchronous execution blocked MCP requests. Native CLI login also did not need the copied authentication files or blanket approval flag. Search now returns success only for a complete, validated result and uses native login from a temporary directory outside the repository.

Codex's default 60-second MCP timeout could interrupt a longer search. The plugin manifest allows the owned search deadline and cleanup to finish. A reproduced macOS process-group permission race now gets a bounded retry after a group-absence probe.

Scope

  • run_search.py owns CLI execution, deadlines, process-group cleanup, completion and optional JSON Schema validation, and versioned retained outcomes.
  • server.mjs uses an asynchronous search bridge and rejects mismatched process/result outcomes. Search accepts an explicit model, turn budget, and JSON Schema.
  • .mcp.json sets the host tool timeout to 1815 seconds. Search retains its separate 180-second default and 1800-second maximum.
  • Plugin 0.4.2, documentation, and executable regression tests describe the checked public-search contract.

Blast Radius

This changes public X/web search and its cached outcomes. The managed ACP agent APIs remain exported. Local-tool denial reduces file and shell exposure but is not an OS sandbox; native Grok configuration may still load. The separate managed project-agent sandbox launch issue is outside this change.

Verification

  • Final npm test passed 13 Node tests, 21 Python tests, the 12-tool MCP smoke check, syntax checks, and repository validation.
  • Cancelled and malformed result tests failed before the fix. Executable fixtures cover schema failures, native environment and flags, deadlines, shutdown, repeated signals, and descendant cleanup.
  • The real macOS interrupt fixture passed 10 consecutive runs after the reproduced permission-race fix. Persistent permission errors remain failures. An earlier timeout fixture returned exit 2 without retaining its failure payload; its cause remains unattributed.
  • Installed live acceptance passed eight checks with Grok CLI 1.0.46 and requested model grok-4.7, including X URLs/authors/dates, an exact-string empty search, unavailable-model rejection, structured output, responsive MCP ping, and synthetic local-tool restrictions.
  • A fresh Codex context completed an X request through installed 0.4.2 grok_search using six turns and a 180-second deadline, without a fallback or raw CLI invocation. Effective MCP configuration reports 1815 seconds.
  • A separate fresh-context fixture call through the installed server completed after 65 seconds using its manifest timeout, with invocation-only test configuration. It did not change saved user configuration.
  • CodeRabbit CLI completed a review. Its executable lookup and repeated-signal findings were reproduced and fixed. Native Astra reviewed the follow-up cleanup and transport changes.

Independent HTTP fetches of the returned X URLs received 403, so the post text was not independently verified. These checks certify completion/routing behavior rather than the factual truth of every generated statement.

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