mirror of
https://github.com/morluto/rea.git
synced 2026-11-05 06:45:22 +00:00
[GH-ISSUE #8821] [Design] Isolate optional provider configuration failures at MCP startup #7763
Open
opened 2026-11-03 16:33:12 +00:00 by bsakaguchi
·
1 comment
No Branch/Tag specified
main
codex/procedure-reference-stacked
release-please--branches--main--components--rea-agents
release-please--branches--main--components--rea-agents--release-notes
codex/kuna-independent-retry
codex/byte-search-overlay-coverage
codex/open-failure-target-receipt
codex/kuna-xref-evidence
codex/ghidra-ambiguous-procedure-recovery
codex/function-source-bundle
codex/trace-function-integration-prototype
codex/snapshot-source-closure
codex/recorded-evidence-array-pages
codex/evidence-recovery-redesign
codex/trace-feature-address-scope
codex/call-discovery-scope
codex/ghidra-literal-candidate-evidence
codex/decompile-directory-independent-retry
codex/retry-provenance-base
codex/value-flow-capability-experiment
codex/ghidra-containing-instruction
cursor/readme-discord-button-ef9f
dependabot/github_actions/actions/setup-node-7.1.0
dependabot/github_actions/actions/upload-artifact-7.0.2
dependabot/npm_and_yarn/npm-minor-and-patch-d8d97ce6df
codex/kuna-1989
fix/8559-native-ui-fixture-ownership
fix/8555-go-verifier-mcp-ownership
codex/provider-capability-recovery
fix/8642-rizin-target-stdin
codex/ghidra-memory-effect-scope
codex/ghidra-annotation-entry-selector
codex/ghidra-readonly-recovery
codex/ghidra-regex-verifier-recovery
codex/evidence-discovery-view-guidance
fix/8545-bulk-append-overflow
fix/8428-navigation-refusal-alternatives
codex/address-context-recovery
codex/matching-member-limitations
codex/unknown-scope-contract
codex/evidence-view-guidance
feat/8373-native-trace-views
codex/ghidra-snapshot-verifier-binding
codex/elf-export-visibility
codex/evidence-view-recovery
codex/native-reference-cli-help
codex/provider-candidate-observation-scope
codex/kuna-session-verification
codex/ghidra-switch-lifetime-guidance
codex/pseudocode-paging-discovery
codex/clarify-evidence-view-support
codex/kuna-xrefs-selector-recovery
codex/context-capacity-recovery
codex/evidence-closure-large-links
codex/same-function-evidence-identity
codex/ghidra-verifier-inspected-jdk
codex/audit-guided-workflows
codex/crash-prompt-retained-dossiers
codex/analysis-view-error-recovery
codex/kuna-verifier-target-selection
codex/ghidra-selected-project-call-coverage
codex/docs-native-analysis-scope
codex/ghidra-java-socket-boundary
codex/ghidra-retained-snapshot-verifier
codex/ghidra-search-inventory-facts
fix/8284-zero-argument-parameter-bindings
fix/8198-ui-action-handler-offset
fix/8257-elf-entry-label-identity
fix/8304-deferred-output-schema-projection
fix/8277-call-path-computed-target-uncertainty
fix/pr-8089-conflicts
fix/ci-static-duplicate-export
dependabot/npm_and_yarn/lint-staged-17.6.0
dependabot/github_actions/actions/download-artifact-8.0.2
dependabot/npm_and_yarn/write-file-atomic-8.0.0
dependabot/npm_and_yarn/canonicalize-5.1.0
dependabot/github_actions/actions/cache/restore-6.1.0
dependabot/npm_and_yarn/toon-format/toon-4.4.0
dependabot/github_actions/actions/deploy-pages-5.0.1
codex/review-fixes-pr-2403
codex/review-fixes-pr-2400
codex/process-terminal-width
codex/test-brittleness-cleanup
verify/7167-browser-connect-macos
fix/7167-browser-connect
feat/native-matching-allowance-setting
feat/browser-scenario-dry-run
test/managed-caller-parameters-20261024
codex/parser-fortythird-boundaries
fix/6926-pinvoke-platform-decorations-20261023
fix/6889-har-body-encoding-20261023
fix/6888-sqlite-schema-budget-20261023
fix/dependency-security-gates-6708
cursor/evidence-overwrite-rebase-b4ac
feat/4057-verify-native-exports
fix/windows-acl-observer-overhead-20261022
cursor/erlang-beam-restack-4476
cursor/pe-certificate-review-bf32
fix/6116-javascript-application-fs-errors
fix/6061-unmapped-runtime-script-unknown
feat/browser-scenario-summary
fix/pe-certificates
codex/verify-3407
cursor/rebase-5699
cursor/rebase-5352
cursor/rebase-5600
cursor/fix-cli-schema-omission-10a8
codex/audit-hopper-shutdown-reasons-20261021
fix/demangle-swift-omitted-record
fix/nib-boolean-value-types
cursor/cancellation-partial-observation-a5ac
fix/ib-object-limit-reasons
fix/electron-fuse-limit-advice
fix/kuna-doctor-dangling-cache
fix/fixed-budget-refusal-advice
fix/js-ipc-listener-dedup
fix/js-return-member-provenance
fix/dmg-integrity-retry-advice
fix/ida-doctor-readiness
fix/kuna-version-probe-output-drain
fix/legacy-swift-runtime-name-matching
fix/dylib-lazy-load-commands
fix/browser-scenario-startup-cancel
fix/swift-nested-punycode-classification
fix/compare-unselected-scopes
fix/objc-method-budget-coverage
fix/dmg-mounted-root-observations
audit/ci-tests-20261019-round2
release/6.7.0
fix/wabt-cleanup-retry-resolution
fix/electron-fuse-elf-pe-architecture
fix/native-plist-descriptor-ownership
fix/kuna-caller-cleanup-ownership
experiment/atomic-codemode-20261016
review/first-contributor-3776
fix/call-resolution-full-read-cycles
fix/member-mutation-selection-repeat
experiment/atomic-re-tools-20261015
perf/member-mutation-lazy-origins
perf/static-network-mutation-index
fix/hopper-startup-lifecycle
audit/3050-windows-proof-20261015
feat/windows-window-capture-2183
audit/3049-windows-proof-20261015
audit/3735-macos-fixtures-20261015
fix/batch-decompile-null-pseudocode
fix/kuna-inventory-honors-jobs
experiment/browser-codemode-tool-design-20261015
fix/hopper-clean-runtime-argv
codex/review-2049-27f1b367
review-fixes/pr-2787-routing
fix/3360-scoped-this-emitters
fix/3367-replaced-global-effects
fix/3838-compact-any-value-items
test/hopper-download-probe-20261015
codex/windows-runtime-creation-red-green-20261015
codex/windows-readonly-root-red-green-20261015
codex/windows-root-share-red-green-20261015
codex/exp-1685-win-mcp-startup
codex/bug-sweep-20261015
investigate/2190-windows-package-phases
investigate/3543-macos-cli-deadline
perf/3281-reverse-tools-feedback-quality
fix/3406-hopper-doctor-fixture
fix/3341-wrapper-require-test-context
fix/3301-owned-uninstall-fixtures
fix/3164-compiler-input-ownership
fix/pcap-cleanup-stdout-newline-20261014
perf/interface-builder-summary
codex/review-fixes-pr-1977
fix/ghidra-effective-jvm-platform
fix/docs-turkish-rust-link-20261013
fix/main-maintenance-ci-20261010
fix/recover-binary-session-process-effects
codex/review-fixes-pr-2457
codex/ci-required-cancellation-gate
fix/main-format-baseline-20261013
fix/setup-preserve-entry-fields
cursor/restore-main-checks-1ffc
fix/ghidra-bridge-hashmap-import
codex/shared-ci-jadx-json-default-20261013
codex/shared-ci-ghidra-test-groups-20261013
codex/shared-ci-java-fixture-format-20261013
codex/fix-intrinsic-invocation-boundaries
test/release-preflight-reusable-jobs
test/js-parameter-provenance-expectation
fix/linux-hopper-verification-current
test/2419-ghidra-elf-probe-size
followup/pr-1544-native-ida
codex/fold-pr-2230-contribution
docs/readme-responsible-use
fix/issue-2064
fix/issue-2050
fix/issue-2053
fix/issue-1968
fix/issue-1945
experiment/codemode-bridge-20261011
fix/tool-effects-negative-wording-1904-20261012
fix/1842-electron-interop-provenance
feat/recover-javascript-multi-input
refactor/website-i18n-prep
fix/nativeaot-pe-virtual-extent
fix/browser-verifier-ci-hang
fix/pe-resources-input-selection
docs/beginner-friendly-guides
docs/beginner-setup-guide
fix/javascript-analysis-worker-1563
fix/1649-ghidra-duplicate-names
fix/javascript-export-keys-integration-1369
test/maintenance-boundary-contracts-20261011
review/javascript-export-keys-1369
review/process-live-progress-1483
test/javascript-1495-growth-ratio
fix/ci-escape-timing
docs/normalized-terminal-geometry-1450
release/6.3.0
archive/release-6.3.0-pr1381
release/6.2.0
fix/electron-preload-dynamic-override
fix/javascript-self-referential-bundler-edges
release/6.1.0
cursor/grok-client-cherry-pick-0b56
feat/signature-posture
feat/dyld-shared-cache
feat/artifact-integrity-policy
feat/pkg-inventory
release/6.0.0
chore/sync-release-5.0.0
release/5.0.0
cursor/cloud-agent-node-787e
fix/javascript-xhr-open-endpoints
review/pr-711-realpath-fallback-wording
cleanup/replay-confinement
codex/test-suite-performance
codex/issue-foundations
codex/address-open-issues-2026-07-20
agent/javascript-vite-rollup-esbuild-adapters
agent/process-cleanup
agent/triage-integration
agent/unknown-commands-registry
feat/mcp-identity-metadata
morlvps/issue_cleanup
codex/installer-redesign
morl/roadmap-investigation-core
morl/roadmap-investigation-docs
release-please--branches--main--components--rea
rea-agents-6.8.0
rea-agents-6.7.0
rea-agents-6.6.0
experiment/atomic-codemode-wait-runtime-20261016
rea-agents-6.5.0
rea-agents-6.4.0
rea-agents-6.3.0
rea-agents-6.2.0
rea-agents-6.1.0
rea-agents-6.0.0
rea-agents-5.0.0
rea-agents-4.1.0
rea-agents-4.0.1
rea-agents-4.0.0
rea-agents-3.2.1
rea-agents-3.2.0
rea-agents-3.1.0
rea-agents-3.0.0
rea-agents-2.7.0
rea-agents-2.6.0
rea-agents-2.5.1
rea-agents-2.5.0
rea-agents-2.4.0
rea-agents-2.3.0
rea-agents-2.2.0
rea-agents-2.1.0
rea-agents-2.0.0
rea-agents-1.7.0
rea-agents-1.6.0
rea-agents-1.5.0
rea-agents-1.4.0
rea-agents-1.3.0
rea-agents-1.2.0
rea-agents-1.1.0
rea-agents-1.0.0
rea-agents-0.5.0
rea-agents-0.4.0
rea-agents-0.3.0
rea-0.2.1
rea-0.2.0
Labels
Clear labels
area: bridge
area: bridge
area: build
area: build
area: build
area: cli
area: domain
area: evidence
area: mcp
area: native
area: providers
area: runtime
area: server
area: setup
area: tests
bug
design
documentation
enhancement
enhancement
enhancement
experiment
help wanted
i18n
invalid
P0: critical
P1: high
P2: medium
P2: medium
P2: medium
P3: low
performance
provider-request
pull-request
Mirrored from GitHub Pull Request
question
roadmap
triage
No labels
area: bridge
area: bridge
area: build
area: build
area: build
area: cli
area: domain
area: evidence
area: mcp
area: native
area: providers
area: runtime
area: server
area: setup
area: tests
bug
design
documentation
enhancement
enhancement
enhancement
experiment
help wanted
i18n
invalid
P0: critical
P1: high
P2: medium
P2: medium
P2: medium
P3: low
performance
provider-request
pull-request
question
roadmap
triage
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set.
Reference
morluto/rea#7763
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @morluto on GitHub (Nov 3, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/8821
Before submitting
Decision needed
Should a malformed configuration for one optional provider prevent the entire MCP server from initializing, even when the caller needs a different provider or a local inspection tool? If not, how should REA surface the configuration failure without silently ignoring it or weakening fail-closed controls?
Context and evidence
On macOS arm64, REA #8820 head
a4b7dfcd1, Node 24.22.1, real Kuna 1.990, Ghidra 12.1.4 and TypeScript MCP SDK 2.3.1, I setREA_GHIDRA_PROJECT_PATHto an owned.gzfpacked program, which is invalid for the current expanded-project contract. A fresh stdio MCP connection failed during initialization; the SDK's thrown error wasConnection closed. REA's stderr contained the specific setting and the packed-program recovery from #8820. Notools/listor tool call was available in that failed session.With only that environment variable removed, a fresh server initialized, listed 234 tools, opened the same owned Mach-O with explicit Kuna selection, and completed
inspect_macho. The file SHA-256 stayed unchanged and it was not executed. As a separate control, the standalone CLIrea inspect-machosucceeded both with and without the invalid Ghidra setting. The test observed the SDK and captured server stderr directly; it does not establish what any particular MCP host shows its user or what an autonomous agent would do.Expected interaction with targets
The verified controls read an existing local target and may launch caller-supplied static tools. No target execution or modification is proposed. A possible isolation design would require independent scope and lifecycle review.
Boundary details (optional)
Keep the invalid Ghidra configuration visible as a typed failure, including its recovery, and refuse an explicit request that needs it. Do not silently select a different provider, pretend Ghidra is available, or ignore invalid global transport/security/resource settings. Preserve session, target identity and cleanup semantics. Decide which settings can be isolated without changing their authority or accidentally admitting a partial configuration.
Options and tradeoffs
Compare failing the whole server with better host-visible startup diagnostics, a deliberately limited diagnostic server, and provider-scoped admission that leaves unrelated operations available while reporting Ghidra invalid. Account for MCP host behavior and catalog/availability truthfulness; a diagnostic-only startup must not appear to be a fully healthy server. This is a design question, not a request to implement automatic fallback.
Verification available so far
I have a prototype or observed results.
Success criteria and open questions
Exercise malformed Ghidra, Kuna, IDA and shared/global settings; explicit and automatic provider selection; unrelated local tools; no viable provider; host-visible diagnostics; fixing the environment and reconnecting; cleanup and cancellation. Distinguish unknown host behavior and preserve invalid-setting details. The current control covers one malformed optional setting and one host; cross-platform behavior and a controlled agent trace are unverified.
References
Related: #8819 / #8820 for the
.gzfrecovery wording, #8565 for unsupported-provider discovery after a session starts, and #3751 for existing-project selection. CLIrea doctoralready reports this setting asconfig_drift; this question concerns the MCP server being unable to start and serve any tool.@gensokyo-dev @kaoru0822-kitauji @N0zoM1z0
Source-derived boundary
At #8820 head
a4b7dfcd1,src/main.tssnapshots the environment and callsparseConfigbefore selecting deferred or eager MCP startup.parseConfigadmits the combined native-analysis environment, including the Ghidra project setting; any resulting configuration error is written to stderr and returns before server creation. This is consistent with the observed initialization failure. The standalone CLI control demonstrates that at least the testedinspect-machopath does not require that same admission. This is source-derived reasoning for the control, not proof that every optional setting can safely be deferred.Scoped-registration control
On the same checkout and host, I started a fresh stdio MCP server with
REA_MCP_TOOL_FAMILIES=pcap. With the Ghidra project setting absent, it initialized and listed two packet-capture tools, includinginspect_pcap_capture, without advertisingprocedure_pseudo_code. Adding the same invalid.gzfproject setting made SDK initialization fail withConnection closed; the setting-specific diagnostic was on server stderr. No packet capture was opened in this control. This shows that catalog scoping alone does not currently isolate this provider-specific configuration error; it does not establish which other family or configuration failures can safely be isolated.Existing isolation precedent and configuration matrix
On the same #8820 checkout and host, separate fresh
REA_MCP_TOOL_FAMILIES=pcapstdio sessions produced these results:.gzfGhidra project pathConnection closed; setting diagnostic on stderrREA_IDA_MCP_CONFIGConnection closed; setting diagnostic on stderrREA_JEB_MCP_URLREA_KUNA_COMMANDREA_MCP_MAX_RESPONSE_BYTES=1Connection closed; transport-budget diagnostic on stderrA separate unscoped session with the same invalid Kuna command initialized, but an explicit Kuna
open_binaryreturnedprovider_unavailable, identifiedopen_options_invalid, and namedREA_KUNA_COMMANDin its recovery. This is an observed example of leaving an unrelated catalog available while refusing the malformed provider selection. Source inspection also showsnativeAnalysisEnvironmentintentionally excludes JEB-only URL and timeout settings from aggregate native admission; Kuna parses its own configuration. This does not establish that Ghidra and IDA settings have identical owners or that all can be moved safely. Invalid shared transport limits are a separate fail-closed case and must not be silently replaced with defaults.Ownership constraint from source
Ghidra project configuration has cross-setting rules: a program name requires a project, and an existing project conflicts with import/analysis overrides.
parseConfigturns the validated project and name into a singleghidraExistingProjectselection; the IDA provider similarly consumes a validated registration path. Simply deleting bad fields or replacing them with defaults would lose the caller's choice and could cause Ghidra to import a fresh program instead of refusing the selected project. Any isolation work needs to carry the provider-owned invalid result through composition and readiness, while preserving all coupled settings and distinguishing unavailable from unconfigured. This is a source-derived design constraint, not an implemented prototype or assertion that a particular refactor is safe.Syntactically valid but missing project
On the same #8820 checkout and host, a fresh server configured with an absolute, nonexistent
missing.gprand a program name initialized. An explicit Ghidraopen_binaryfailed withconfiguration_invalid,REA_GHIDRA_PROJECT_PATHand anENOENTdiagnostic. Selecting Kuna explicitly afterward succeeded and produced pseudocode for the same unchanged target. In a separate status call while Kuna was active, the Ghidra candidate reported hostavailability: availableand target supportsupported: its installation was valid, even though the configured project could not be opened.rea doctor --provider ghidra --target <target>similarly reported healthy host/target checks. REA's documentation describes these provider checks as host-level, so this is not presented as a false installation claim or a guarantee that a project is usable.For an isolation design, this means host installation readiness, syntactic configuration validity, project accessibility, target applicability and actual program/target identity are distinct facts. Moving a malformed project setting out of global startup must not turn it into a fresh-import choice or imply that checking the executable alone established project readiness. A missing
.gprcontrol does not prove behavior for malformed project contents, changed identities or concurrent edits.Failed selection preserves an existing session
With the same missing
.gprconfiguration, separate real compact and full MCP sessions first opened the target explicitly with Kuna and resolved a function. Each complete status reported Ghidra's host available and the target format supported. Explicitly selecting Ghidra then failed with the project configuration error; the following Kuna lookup still succeeded with the same Evidence ID and Kuna attribution. Successful replies validated against their advertised schemas, and the target digest was unchanged. This verifies the existing failure-preservation behavior for this one missing-project path; an isolation change should retain it rather than terminating or replacing a usable binding.Automatic selection after an isolated Kuna configuration error
On the Kuna 1.990 validation checkout, with
REA_KUNA_COMMAND=relative/kuna, an owned arm64 Mach-O and real Ghidra 12.1.4 / JDK 21 on macOS arm64, fresh compact and full MCP sessions both initialized.open_binarywithout an explicit provider returnedcapability_unavailablewithselection_reason: ambiguous: Ghidra and Hopper were candidates, while Kuna appeared in rejections asopen_options_invalidwith the invalid setting and its correction. On each same connection, explicit Ghidra selection then succeeded andprocedure_pseudo_codereturned Ghidra-attributed Evidence. The target SHA-256 stayed unchanged. This tests the existing isolated Kuna configuration path and a multiple-provider host; it does not establish how automatic selection behaves when there is only one viable provider or no viable provider, or imply that malformed Ghidra settings are already isolated.One and zero viable providers with an invalid Kuna setting
On the same validation checkout and host,
REA_KUNA_COMMAND=relative/kunaand a nonexistent absolute Hopper launcher left Ghidra as the sole viable provider. In compact and full MCP sessions, automaticopen_binarysucceeded and pseudocode returned Ghidra-attributed Evidence. When a nonexistent absolute Ghidra installation was also selected, both profiles still opened the Mach-O as a session target; the subsequent pseudocode request returnedprovider_unavailable, with separate Ghidra, Hopper, IDA and Kuna readiness diagnostics including the invalid Kuna setting.binary_sessionthen showed the target open and no analysis-provider binding, andinspect_machosucceeded on the same connection. The target hash remained unchanged. This control distinguishes target admission from deep-provider readiness; it exercises one host and this combination of unavailable settings, not every provider failure or host client UX.Multiple invalid provider settings
On PR #8829 head
33f2d251e(based on mainc3647ade1, with byte-tool description changes only), with Node 24.22.1 on macOS arm64, starting stdio MCP with both a.gzfGhidra project path and a relative IDA MCP configuration path exited 1 before initialization. Captured stderr named bothREA_IDA_MCP_CONFIGandREA_GHIDRA_PROJECT_PATHand their respective constraints. This checks aggregate startup diagnostics on this combination; it does not show what any MCP host displays to an agent.Provider-scoped admission must retain multiple independent invalid selections rather than dropping all but the first, while continuing to reject invalid shared settings and preserving each explicit configuration. The test did not open or execute a target.
@macjayz commented on GitHub (Nov 4, 2026):
What one MCP host shows the agent
The evidence above leaves host behavior open, so I checked one host. Setup: current main
2d16a40a4(with the duplicatechildNodesimport from #8884/#8886 removed locally so it compiles), Node 26.12.1 on macOS arm64,REA_MCP_TOOL_FAMILIES=pcap, andREA_GHIDRA_PROJECT_PATHset to an owned.gzf-named file. Run directly, the server exits 1 before initialization. Its stderr isREA configuration is invalid: REA_GHIDRA_PROJECT_PATH: Select an expanded .gpr project marker; restore .grez archives first.I then ran Claude Code 2.1.119 as the host (
claude -pwith--strict-mcp-configand only this server):{"name":"rea","status":"connected"}inspect_pcap_capture,inspect_pcap_client.gzfproject path{"name":"rea","status":"failed"}The setting-specific text did not reach the model. Claude Code only wrote it to its per-project MCP log (
~/Library/Caches/claude-cli-nodejs/<project>/mcp-logs-rea/*.jsonl), asServer stderr: REA configuration is invalid: …, next toConnection failed: MCP error -32000: Connection closed. For this host, better startup diagnostics on stderr alone would reach a person reading logs, not the agent. Only something REA serves over the protocol would reach the agent. This is one host, one version and a non-interactive run. I did not check what the interactive/mcpview shows.A possible shape for provider-scoped admission
The Kuna path already fits the constraints above, so Ghidra could follow the same pattern:
REA_GHIDRA_PROJECT_PATH,REA_GHIDRA_PROGRAM_NAMEand the import/analysis overrides that conflict with them as one unit. The result is either a validghidraExistingProjectselection or a retainedConfigurationErrorthat lists every invalid setting. It is never "unset", so a bad project cannot turn into a fresh import.KunaConfigurationFailuredoes withopen_options_invalid,settingandremediation. An explicit Ghidraopen_binarythen fails with the existingconfiguration_invalidprojection and itsdetails.settings. Automatic selection lists Ghidra in its rejections. Status and doctor report Ghidra as configuration-invalid, not asavailablewith only host checks.REA_MCP_*transport, schema and resource limits still stop startup, because no part of the server can safely run with them invalid. Multiple invalid provider groups (Ghidra and IDA together) each keep their own retained error.This would remove the
.gzfand relative-IDA rows of the matrix from startup failure, and would not hide the error. The limited diagnostic server would still be the only option that helps an agent with invalid shared settings. I'd suggest deciding that separately, since it carries the "looks healthy" risk the issue names.Not verified: other hosts (Claude Desktop, Codex, Cursor), Windows, the interactive host UI, and any implementation of the shape above.