Skip to content

🛞 feat: Manage Personal Code Environment Lifecycles - #15369

Merged
danny-avila merged 35 commits into
devfrom
danny-avila/code-environment-ui
Sep 2, 2026
Merged

danny-avila merged 35 commits into
devfrom
danny-avila/code-environment-ui

Conversation

@danny-avila

Copy link
Copy Markdown
Collaborator

Summary

I added self-service lifecycle management for principal-owned code workers, including a settings UI, owner-authorized revocation, and account-deletion cleanup. This PR is stacked on #15367 and uses the lifecycle fencing in LibreChat-AI/code-interpreter#70.

  • Added a Code environments settings panel that issues a one-time librechat-code pairing command, lists accessible environments, and confirms revocation.
  • Exposed only safe control-plane identifiers and names to authenticated clients while keeping deployment URLs and administrator tokens server-side.
  • Persisted the exact control-plane identity and worker principal for each environment.
  • Required DELETE permission before revoking a worker and removing its environment and ACL entries.
  • Revoked user-bound Code API credentials before environment deletion and before account deletion.
  • Revoked orphaned pairings when registry persistence fails after upstream pairing.
  • Added data-provider queries, mutations, cache keys, response types, and English UI copy.
  • Added focused registry, HTTP, route, controller, account-deletion, and settings-registry coverage.

Change Type

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Testing

  • Ran 45 focused LibreChat backend tests across the code registry, HTTP handlers, routes, and account-deletion controller.
  • Ran 10 settings-registry frontend tests.
  • Ran ESLint and import sorting for every touched source file.
  • Built data-schemas, data-provider, API, and the current frontend CI bundle; ran the frontend TypeScript check.
  • Ran an isolated live E2E with LibreChat on 33080, MongoDB on 27028, Code API on 23112, and Redis on 26379.
  • Verified owner pairing/list/delete, non-owner list/delete isolation, invalidation of an unredeemed pairing after deletion, successful credential redemption, and removal of the active Redis credential after deletion.

Test Configuration:

  • LibreChat: local production server, port 33080
  • MongoDB: Mongo 8 container, port 27028, isolated database
  • Code API: production Docker image from 🧯 fix: Fence Worker Pairing Revocation code-interpreter#70, port 23112
  • Redis: Redis 7 container, port 26379
  • Worker transport: outbound-only bridge with principal binding
  • Sandbox: separate network-disabled NsJail service from the existing bridge E2E topology

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • I have made pertinent documentation changes
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes
  • Any changes dependent on mine have been merged and published in downstream modules.

@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review exact head 27b3401c79dd91841cf8df94f706f49a77599347, including owner authorization, remote revocation, account deletion, and the self-service settings UI.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 30, 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-09-01T23:54:28.327252Z dce0d37 Manual request
ℹ️ 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: 27b3401c79

ℹ️ 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 packages/api/src/code/environments.ts
Comment thread packages/api/src/code/bridge.ts
Comment thread api/server/controllers/UserController.js Outdated
Comment thread packages/api/src/code/lifecycle.ts Outdated
Comment thread client/src/components/Nav/Settings/CodeEnvironments.tsx Outdated
Comment thread client/src/components/Nav/Settings/CodeEnvironments.tsx Outdated
Comment thread client/src/components/Nav/Settings/CodeEnvironments.tsx Outdated
Comment thread packages/api/src/code/lifecycle.ts Outdated
Comment thread packages/api/src/code/environments.ts Outdated
Comment thread client/src/components/Nav/Settings/CodeEnvironments.tsx Outdated
@danny-avila
danny-avila force-pushed the danny-avila/code-environment-ui branch from 27b3401 to ad4ffae Compare August 30, 2026 18:46
@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review exact head ad4ffae and report only actionable findings introduced by this PR.

@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: ad4ffaeb16

ℹ️ 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 api/server/controllers/UserController.js Outdated
Comment thread api/server/routes/code-environments.js Outdated
Comment thread client/src/data-provider/CodeEnvironments.ts Outdated
Comment thread packages/api/src/code/environments.ts Outdated
@danny-avila
danny-avila force-pushed the danny-avila/code-environment-ui branch from ad4ffae to 736270a Compare August 30, 2026 19:12
@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review exact head 736270a and report only actionable findings introduced by this PR.

@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review the exact current head d658767, including the backend lifecycle type fix.

@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: d658767f45

ℹ️ 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 api/server/controllers/UserController.js Outdated
Comment thread packages/api/src/code/lifecycle.ts Outdated
Comment thread packages/api/src/code/http.ts Outdated
Comment thread packages/api/src/code/environments.ts Outdated
@danny-avila
danny-avila force-pushed the danny-avila/code-environment-ui branch from d658767 to 72206dd Compare August 30, 2026 20:25
@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review\n\nPlease review exact head commit 72206dd7c192b419619d305da2f74a975ba366e3 after the lifecycle, atomic quota, batched authorization, CLI cleanup, and stack-conflict fixes.

@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

https://github.com/danny-avila/LibreChat/blob/72206dd7c192b419619d305da2f74a975ba366e3/packages/data-schemas/src/methods/codeEnvironment.ts#L117
P2 Badge Preserve referenced environments during account cleanup

When a departing user created a deployment-principal environment that was shared and selected by another user's agent, this bulk cleanup deletes every environment owned by the departing user without the Agent.exists protection used by normal removal. The other user's agent survives account cleanup but its environment record disappears, so subsequent execution fails; fresh evidence beyond the earlier removal-path fix is that all three account-deletion flows call this separate bulk method, which bypasses the reference check entirely.

ℹ️ 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 packages/api/src/code/lifecycle.ts
Comment thread packages/data-schemas/src/methods/codeEnvironment.ts
Comment thread packages/api/src/code/environments.ts Outdated
Comment thread packages/api/src/code/http.ts Outdated
@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review exact head commit c69725779 after durable revocation reconciliation, index-independent atomic quotas, agent/environment removal fencing, referenced-environment preservation, principal-auth-aware discovery, and static/type fixes. Report only actionable findings on this exact head.

@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: c697257792

ℹ️ 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 packages/api/src/code/lifecycle.ts
Comment thread packages/api/src/code/lifecycle.ts
Comment thread packages/data-schemas/src/methods/codeEnvironment.ts Outdated
Comment thread packages/data-schemas/src/methods/codeEnvironment.ts
Comment thread packages/data-schemas/src/methods/codeEnvironment.ts Outdated
Comment thread packages/data-schemas/src/methods/codeEnvironment.ts
Comment thread packages/data-schemas/src/methods/codeEnvironment.ts
@danny-avila
danny-avila force-pushed the danny-avila/code-environment-ui branch from c697257 to dac17a9 Compare August 30, 2026 21:11
@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review

@danny-avila
danny-avila force-pushed the danny-avila/code-environment-ui branch from dac17a9 to 107e42e Compare August 30, 2026 21:12

@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: dac17a96a9

ℹ️ 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 packages/api/src/code/http.ts Outdated
Comment thread packages/api/src/code/environments.ts
Comment thread client/src/components/Nav/Settings/CodeEnvironments.tsx
Comment thread packages/api/src/code/environments.ts Outdated
Base automatically changed from danny-avila/self-service-code-pairing to dev September 1, 2026 22:46
…onment-ui-review

# Conflicts:
#	api/server/routes/code-environments.test.js
#	packages/api/src/code/bridge.ts
#	packages/api/src/code/environments.ts
#	packages/api/src/code/http.spec.ts
#	packages/api/src/code/http.ts
#	packages/api/src/code/index.ts
#	packages/data-schemas/src/methods/agent.ts
#	packages/data-schemas/src/methods/codeEnvironment.ts
#	packages/data-schemas/src/schema/codeEnvironment.ts
#	packages/data-schemas/src/types/codeEnvironment.ts
@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current PR head f5ed4a9. Confirm that this exact commit is the reviewed commit and ignore findings that apply only to earlier heads. Please also scrutinize the code inherited from merged PR #15367; make any actionable findings here so they can be fixed on this branch.

@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current PR head 3ccd22d. Confirm that this exact commit is the reviewed commit and ignore findings that apply only to earlier heads. This head also fixes the worker-bound file-priming finding from merged PR #15367.

@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: 3ccd22d1c5

ℹ️ 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 packages/data-schemas/src/methods/agent.ts
Comment thread packages/data-schemas/src/methods/agent.ts Outdated
Comment thread packages/data-schemas/src/methods/codeEnvironment.ts
Comment thread packages/api/src/code/lifecycle.ts Outdated
@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current PR head 848c6e8. Confirm that this exact commit is the reviewed commit and ignore findings that apply only to earlier heads. This round restores the dev skill contract, renews live agent-reference leases, adds fair revocation retry scheduling, and fences direct registration against concurrent account deletion.

@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current PR head 04a5f01. Confirm that this exact commit is the reviewed commit and ignore findings that apply only to earlier heads. This differs from the prior requested head only by the explicit isolated-declarations type annotation required by the package build.

@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: 04a5f01f2e

ℹ️ 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 packages/api/src/code/lifecycle.ts
Comment thread packages/data-schemas/src/methods/codeEnvironment.ts
Comment thread config/delete-user.js
@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review commit 0cab1e5

@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: 0cab1e5d2d

ℹ️ 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 packages/data-schemas/src/methods/codeEnvironment.ts
Comment thread packages/data-schemas/src/methods/agent.ts Outdated
Comment thread api/server/controllers/agents/v1.js
Comment thread packages/api/src/code/lifecycle.ts
@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review commit c7b2592

@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review commit 868d662

@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: 868d662f95

ℹ️ 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 packages/api/src/code/http.ts
Comment thread packages/data-schemas/src/methods/agent.ts
Comment thread packages/api/src/code/lifecycle.ts
Comment thread packages/api/src/code/lifecycle.ts
@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review commit 03ce617

@danny-avila

Copy link
Copy Markdown
Collaborator Author

@codex review commit dce0d37

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: dce0d37bb5

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

@danny-avila danny-avila changed the title 🛰️ feat: Manage Personal Code Environments 🛞 feat: Manage Personal Code Environment Lifecycles Sep 2, 2026
@danny-avila
danny-avila merged commit 164f146 into dev Sep 2, 2026
38 checks passed
@danny-avila
danny-avila deleted the danny-avila/code-environment-ui branch September 2, 2026 01:10
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