Skip to content

Implement Nexa 3.0 Open Programs in Code - #2

Merged
ouyangyipeng merged 3 commits into
masterfrom
feat/nexa-3.0-upgrade
Oct 26, 2026
Merged

ouyangyipeng merged 3 commits into
masterfrom
feat/nexa-3.0-upgrade

Conversation

@ouyangyipeng

@ouyangyipeng ouyangyipeng commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

What kind of change does this PR introduce?

Adds a native Nexa 3.0 terminal workflow while retaining the existing 2.4 conversation interface.

What is the current behavior?

The terminal only exposes the legacy Agent/session path. Open Program goals, evidence, revisions and exact patch grants are not available through its host or Ink UI.

What is the new behavior?

  • Integrate the pinned OpenCompiler, ProgramSession and ProgramStore through typed open_* host events and an explicit Ink mode.
  • Support check, draft, build/locked replay, goal execution, Author resolution, maintenance, evidence/diff review, explicit grant/apply, exact-ID cancellation, recovery and capsules.
  • Persist clarification sync with source/revision CAS, recover interrupted file writes, retain concurrent original-file edits and preserve CRLF.
  • Reject stale environment and draft bindings before execution or authorization, keeping legacy permissions separate.

Additional context

Runtime: Nexa v3.0.0, commit 274379606e53c90d2d25774f6bb8984c777d0759.

Local evidence: prior full Python suite 113 passed / 1 opt-in provider skipped (including 3 actual OCI cases), Ink 17 passed, real native/legacy PTY and isolated wheel. The source-write completion fix passed all 16 recovery tests and installed-wheel crash probes. The PR review's prepared-sync rejection recovery regression is also fixed: all four persistence boundaries with and without rejection now assert one committed Author answer. All 51 affected Python tests and static checks pass. The rebuilt isolated wheel passes legacy/native smoke, with all 21 Python modules byte-matched to the source and installation; unaffected evidence is reused. Cross-client activity persistence and exact cancellation passed using the packaged extension bridge. Independent review is READY; no paid provider calls were made.

The initial final-head PR CI passed, while its parallel push run exposed an existing HTTP test startup race. A module-local test clock now expires only after the mock request starts; all four GET/POST deadline/cancel cases pass with a 250 ms delayed worker start, and all 10 boundary tests pass. Product code is unchanged by this test correction. Final remote CI must pass before Rebase and merge. Native execution requires the configured environment and pinned OCI image.

Root cause: NA
Solution: Integrate the pinned Open Programs SDK with typed host and
  Ink workflows for goals, evidence, grants and persistent recovery.
  Preserve legacy sessions and bind source and environment identities.
Risks: Native execution requires OCI and explicit environment setup.
  Source recovery retains originals for concurrent edit reconciliation.
Dependency: Nexa v3.0.0 at 274379606e53c90d2d25774f6bb8984c777d0759
Links: https://github.com/Nexa-Language/Nexa/releases/tag/v3.0.0
Copilot AI balanced review requested due to automatic review settings October 26, 2026 08:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T08:21:23.191632Z d9f3eaa PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d9f3eaa488

ℹ️ 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".

Comment thread nexa_code/open_source.py Outdated
Comment on lines +162 to +166
if not confirmed:
rejected = pending.model_copy(update={"state": "rejected"})
self.store.set_reference(self.key, pending.digest, rejected)
return rejected
if pending.state == "prepared":

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the uncommitted answer state when rejecting a sync

If the process stops after prepare() persists its prepared record but before _answer() commits the author answer, the recovered diff can be rejected through /reject-sync. This changes its state to rejected, so a subsequent /sync skips _answer() because it only retries records whose state is prepared. The current revision is still base_revision, causing every confirmation attempt to fail with revision_conflict; the pending record also blocks new answers, builds and runs through ensure_ready(). Preserve whether the answer still needs committing when rejecting the diff, or determine that from the current revision before retrying.

Useful? React with 👍 / 👎.

Root cause: Rejecting a prepared sync hid its uncommitted Author answer.
Solution: Inspect the current revision before retrying the saved answer,
  retaining the existing record format and committed-revision recovery.
  Cover all four persistence boundaries with and without rejection and
  require exactly one committed Author answer in every case.
Risks: Recovery must preserve revision conflicts and avoid duplicate
  answers. All 51 affected tests and static checks pass locally.
Dependency: NA
Links: #2
Root cause: The deadline could expire before the test worker entered
  its simulated request, making the inflight-closure assertion flaky.
Solution: Advance a module-local test clock only after send starts.
  Keep asyncio's clock real and retain GET/POST closure assertions.
Risks: The fixture must still exercise actual task cancellation.
  Verify deadline and cancel cases with delayed worker startup.
Dependency: NA
Links: #2
@ouyangyipeng
ouyangyipeng merged commit 1d4bd72 into master Oct 26, 2026
2 checks passed
ouyangyipeng added a commit that referenced this pull request Oct 26, 2026
Root cause: Rejecting a prepared sync hid its uncommitted Author answer.
Solution: Inspect the current revision before retrying the saved answer,
  retaining the existing record format and committed-revision recovery.
  Cover all four persistence boundaries with and without rejection and
  require exactly one committed Author answer in every case.
Risks: Recovery must preserve revision conflicts and avoid duplicate
  answers. All 51 affected tests and static checks pass locally.
Dependency: NA
Links: #2
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.

2 participants