refactor: consume acpx runtime library#61495
Conversation
|
Validation update on current head Implemented:
Local validation run:
Review/comment status:
Current blocker:
Once a maintainer marks this PR ready for review, CI should run on the current head. |
|
Final report for current head Implemented:
Validation run on this head:
Review/comment status:
CI status:
Remaining blocker:
|
Greptile SummaryThis PR replaces the duplicated ACP runtime implementation inside Confidence Score: 5/5Clean refactoring PR that removes duplicated runtime code; no new logic or risk introduced. All findings are P2 or lower. The package version is correctly set to [email protected] (a published release, not a GitHub commit), the temporary build-script allowlist was properly removed in a prior commit, import boundaries are respected, and the behavioral changes to channel visibility tracking appear intentional and well-contained. No files require special attention. Reviews (1): Last reviewed commit: "Merge branch 'main' into refactor/acpx-r..." | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fcea7cdd70
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 82b6d37c36
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (normalized && freshSessionKeys.delete(normalized)) { | ||
| return undefined; |
There was a problem hiding this comment.
Preserve discard marker until a fresh session is saved
The reset wrapper clears the freshSessionKeys marker on the very first load, before a new record is persisted. If /new or /reset triggers discardPersistentState, and the next session initialization fails transiently (for example backend init fails before save), retries will fall back to the old persisted session because the marker is already consumed while the stale record is still on disk. This can silently reopen the pre-reset conversation after a failed reset attempt; keep the discard state active until a successful save (or remove the old record) so reset behavior remains durable across retries.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a0aabc2199
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const runtimeBackend = this.deps.requireRuntimeBackend(configuredBackend || undefined); | ||
| await runtimeBackend.runtime.prepareFreshSession?.({ |
There was a problem hiding this comment.
Avoid throwing lookup in reset backend-unavailable recovery
closeSession is supposed to tolerate unavailable backends when allowBackendUnavailable is true (the reset path in resetAcpSessionInPlace sets this), but this recovery branch re-calls requireRuntimeBackend, which itself throws on missing/unhealthy backends. When /new/reset runs while the ACP backend is missing or unhealthy, this secondary throw escapes and turns a best-effort close into a hard failure, so the reset flow aborts instead of continuing with reinitialization.
Useful? React with 👍 / 👎.
| mcpServers: toAcpMcpServers(params.pluginConfig.mcpServers), | ||
| permissionMode: params.pluginConfig.permissionMode, | ||
| nonInteractivePermissions: params.pluginConfig.nonInteractivePermissions, | ||
| timeoutMs: | ||
| params.pluginConfig.timeoutSeconds != null |
There was a problem hiding this comment.
Pass retained ACPX config knobs through to runtime
createDefaultRuntime now builds a narrowed options object for AcpxRuntime, but it no longer forwards config knobs that are still part of the plugin contract (queueOwnerTtlSeconds and strictWindowsCmdWrapper are still parsed/resolved in extensions/acpx/src/config.ts). After this refactor those user-provided settings silently become no-ops and behavior falls back to package defaults, which is a regression for installations that tuned those values.
Useful? React with 👍 / 👎.
|
Landed without landpr, forgive me |
* refactor: consume acpx runtime library * refactor: remove duplicated acpx runtime files * fix: update acpx runtime dependency * fix: preserve acp runtime error codes * fix: migrate legacy acpx session files * fix: update acpx runtime dependency * fix: import Dirent from node fs * ACPX: repin shared runtime engine * ACPX: repin runtime semantics fixes * ACPX: repin runtime contract cleanup * Extensions: repin ACPX after layout refactor * ACPX: drop legacy session migration * ACPX: drop direct ACP SDK dependency * Discord ACP: stop duplicate direct fallback replies * ACP: rename delivered text visibility hook * ACPX: pin extension to 0.5.0 * Deps: drop stale ACPX build-script allowlist * ACPX: add local development guidance * ACPX: document temporary pnpm exception flow * SDK: preserve legacy ACP visibility hook * ACP: keep reset commands on local path * ACP: make in-place reset start fresh session * ACP: recover broken bindings on fresh reset * ACP: defer fresh reset marker until close succeeds * ACP: reset bound sessions fresh again * Discord: ensure ACP bindings before /new * ACP: recover missing persistent sessions
* refactor: consume acpx runtime library * refactor: remove duplicated acpx runtime files * fix: update acpx runtime dependency * fix: preserve acp runtime error codes * fix: migrate legacy acpx session files * fix: update acpx runtime dependency * fix: import Dirent from node fs * ACPX: repin shared runtime engine * ACPX: repin runtime semantics fixes * ACPX: repin runtime contract cleanup * Extensions: repin ACPX after layout refactor * ACPX: drop legacy session migration * ACPX: drop direct ACP SDK dependency * Discord ACP: stop duplicate direct fallback replies * ACP: rename delivered text visibility hook * ACPX: pin extension to 0.5.0 * Deps: drop stale ACPX build-script allowlist * ACPX: add local development guidance * ACPX: document temporary pnpm exception flow * SDK: preserve legacy ACP visibility hook * ACP: keep reset commands on local path * ACP: make in-place reset start fresh session * ACP: recover broken bindings on fresh reset * ACP: defer fresh reset marker until close succeeds * ACP: reset bound sessions fresh again * Discord: ensure ACP bindings before /new * ACP: recover missing persistent sessions
* refactor: consume acpx runtime library * refactor: remove duplicated acpx runtime files * fix: update acpx runtime dependency * fix: preserve acp runtime error codes * fix: migrate legacy acpx session files * fix: update acpx runtime dependency * fix: import Dirent from node fs * ACPX: repin shared runtime engine * ACPX: repin runtime semantics fixes * ACPX: repin runtime contract cleanup * Extensions: repin ACPX after layout refactor * ACPX: drop legacy session migration * ACPX: drop direct ACP SDK dependency * Discord ACP: stop duplicate direct fallback replies * ACP: rename delivered text visibility hook * ACPX: pin extension to 0.5.0 * Deps: drop stale ACPX build-script allowlist * ACPX: add local development guidance * ACPX: document temporary pnpm exception flow * SDK: preserve legacy ACP visibility hook * ACP: keep reset commands on local path * ACP: make in-place reset start fresh session * ACP: recover broken bindings on fresh reset * ACP: defer fresh reset marker until close succeeds * ACP: reset bound sessions fresh again * Discord: ensure ACP bindings before /new * ACP: recover missing persistent sessions
* refactor: consume acpx runtime library * refactor: remove duplicated acpx runtime files * fix: update acpx runtime dependency * fix: preserve acp runtime error codes * fix: migrate legacy acpx session files * fix: update acpx runtime dependency * fix: import Dirent from node fs * ACPX: repin shared runtime engine * ACPX: repin runtime semantics fixes * ACPX: repin runtime contract cleanup * Extensions: repin ACPX after layout refactor * ACPX: drop legacy session migration * ACPX: drop direct ACP SDK dependency * Discord ACP: stop duplicate direct fallback replies * ACP: rename delivered text visibility hook * ACPX: pin extension to 0.5.0 * Deps: drop stale ACPX build-script allowlist * ACPX: add local development guidance * ACPX: document temporary pnpm exception flow * SDK: preserve legacy ACP visibility hook * ACP: keep reset commands on local path * ACP: make in-place reset start fresh session * ACP: recover broken bindings on fresh reset * ACP: defer fresh reset marker until close succeeds * ACP: reset bound sessions fresh again * Discord: ensure ACP bindings before /new * ACP: recover missing persistent sessions
* refactor: consume acpx runtime library * refactor: remove duplicated acpx runtime files * fix: update acpx runtime dependency * fix: preserve acp runtime error codes * fix: migrate legacy acpx session files * fix: update acpx runtime dependency * fix: import Dirent from node fs * ACPX: repin shared runtime engine * ACPX: repin runtime semantics fixes * ACPX: repin runtime contract cleanup * Extensions: repin ACPX after layout refactor * ACPX: drop legacy session migration * ACPX: drop direct ACP SDK dependency * Discord ACP: stop duplicate direct fallback replies * ACP: rename delivered text visibility hook * ACPX: pin extension to 0.5.0 * Deps: drop stale ACPX build-script allowlist * ACPX: add local development guidance * ACPX: document temporary pnpm exception flow * SDK: preserve legacy ACP visibility hook * ACP: keep reset commands on local path * ACP: make in-place reset start fresh session * ACP: recover broken bindings on fresh reset * ACP: defer fresh reset marker until close succeeds * ACP: reset bound sessions fresh again * Discord: ensure ACP bindings before /new * ACP: recover missing persistent sessions
* refactor: consume acpx runtime library * refactor: remove duplicated acpx runtime files * fix: update acpx runtime dependency * fix: preserve acp runtime error codes * fix: migrate legacy acpx session files * fix: update acpx runtime dependency * fix: import Dirent from node fs * ACPX: repin shared runtime engine * ACPX: repin runtime semantics fixes * ACPX: repin runtime contract cleanup * Extensions: repin ACPX after layout refactor * ACPX: drop legacy session migration * ACPX: drop direct ACP SDK dependency * Discord ACP: stop duplicate direct fallback replies * ACP: rename delivered text visibility hook * ACPX: pin extension to 0.5.0 * Deps: drop stale ACPX build-script allowlist * ACPX: add local development guidance * ACPX: document temporary pnpm exception flow * SDK: preserve legacy ACP visibility hook * ACP: keep reset commands on local path * ACP: make in-place reset start fresh session * ACP: recover broken bindings on fresh reset * ACP: defer fresh reset marker until close succeeds * ACP: reset bound sessions fresh again * Discord: ensure ACP bindings before /new * ACP: recover missing persistent sessions
Summary
acpx/runtimeinstead of carrying a forked embedded runtime implementationextensions/acpxto ACPX commita5ed49269cd0b97e651a11fa0af0d95a9a4a3193and allow its build scripts in the workspace install policyextensions/acpx/srcnow that ACPX is the source of truthPaired PR
Validation
pnpm installpnpm test:extension acpxpnpm buildpnpm checkstill fails in unrelated repo-wide tsgo surfaces outsideextensions/acpx(for exampleextensions/anthropic/index.test.ts,src/plugins/*.test.ts,src/gateway/server-methods/chat.ts), so it is not a clean signal for this branchNotes