Skip to content

[docs] Prepare hosted subscription exploration and Fable handoff - #6622

Open
mmabrouk wants to merge 4 commits into
mainfrom
agent/hosted-subscription-connections-plan-20260907
Open

[docs] Prepare hosted subscription exploration and Fable handoff#6622
mmabrouk wants to merge 4 commits into
mainfrom
agent/hosted-subscription-connections-plan-20260907

Conversation

@mmabrouk

@mmabrouk mmabrouk commented Sep 7, 2026

Copy link
Copy Markdown
Member

Context

Agenta Cloud needs UI sign-in to ChatGPT subscriptions, selection in the existing model list, and use across concurrent sessions and multiple agents. The original proposal restricted each connection to one active run, so it is preserved as historical v0 material rather than treated as the current requirements.

Changes

Separate Mahmoud's requirements from explicitly labeled technical inferences. Add a working research document and editable Fable handoff for parallel authentication experiments and full product implementation, without a timebox. The intended outcome is a working integrated flow, including refresh recovery and UI re-login, rather than a recommendation alone.

Explore native shared mounts first, alongside other ways for sessions to publish and reload credentials, including database-backed state and supported hooks. Put a single authentication-owning process last. Either Codex or Pi is sufficient; Grok implementation is excluded. Keep schema and routine integration decisions pragmatic.

Add a non-blocking communication log and current worktree status. Fable has not been contacted by Codex; Mahmoud will edit and send the prompt. This revision contains documents only, not the exploratory implementation itself.

How to review

  1. User requirements.
  2. Working research and implementation.
  3. Editable Fable prompt.
  4. Communication log and status.
  5. Technical inferences, open questions, and the historical v0 proposal.

Validation

Checked relative Markdown links and whitespace. Confirmed that the user requirements and archived v0 contents are unchanged by this handoff revision. No live authentication experiments have run yet.

@vercel

vercel Bot commented Sep 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
agenta-documentation Ready Ready Preview Sep 8, 2026 9:29am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Advanced

Run ID: 7ec16204-72df-4bf3-8382-8cde585b541b

📥 Commits

Reviewing files that changed from the base of the PR and between a8abc8f and a3ca293.

📒 Files selected for processing (7)
  • docs/design/hosted-subscription-connections/README.md
  • docs/design/hosted-subscription-connections/communication-log.md
  • docs/design/hosted-subscription-connections/design-questions.md
  • docs/design/hosted-subscription-connections/fable-prompt.md
  • docs/design/hosted-subscription-connections/status.md
  • docs/design/hosted-subscription-connections/technical-inferences.md
  • docs/design/hosted-subscription-connections/working-research.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • docs/design/hosted-subscription-connections/technical-inferences.md
  • docs/design/hosted-subscription-connections/README.md

Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.


📝 Summary

Summary by CodeRabbit

  • Documentation
    • Added requirements for signing in to ChatGPT through the Agenta UI, displaying subscriptions in the model list, supporting parallel sessions, and enabling project or organization scoping.
    • Added technical analysis and open design questions covering authentication, isolation, persistence, permissions, and concurrent use.
    • Added a historical v0 proposal with an interactive architecture walkthrough, research, implementation plan, context, and status documentation.
    • Added terminology, working research, project status, communication, and handoff documentation.
    • Clarified that Grok is deferred to a later version.

Walkthrough

The PR adds current requirements, design analysis, working research, coordination documents, and status tracking for hosted ChatGPT subscriptions. It also preserves a historical v0 proposal with architecture documents and an interactive HTML walkthrough.

Changes

Hosted subscription connections

Layer / File(s) Summary
Current requirements and design analysis
docs/design/hosted-subscription-connections/README.md, docs/design/hosted-subscription-connections/requirements.md, docs/design/hosted-subscription-connections/technical-inferences.md, docs/design/hosted-subscription-connections/design-questions.md
Defines product requirements, separates requirements from technical inferences, updates terminology and reading order, and records open questions about authentication, concurrency, isolation, scope, persistence, lifecycle, and provider support.
Working implementation research and coordination
docs/design/hosted-subscription-connections/working-research.md, docs/design/hosted-subscription-connections/fable-prompt.md, docs/design/hosted-subscription-connections/communication-log.md, docs/design/hosted-subscription-connections/status.md
Documents the exploratory implementation, architecture experiments, validation scenarios, parallel work tracks, handoff rules, ownership, and current work status.
Historical v0 context and research
docs/design/hosted-subscription-connections/v0/README.md, docs/design/hosted-subscription-connections/v0/context.md, docs/design/hosted-subscription-connections/v0/research.md, docs/design/hosted-subscription-connections/v0/status.md
Documents the historical proposal, provider authentication paths, encrypted authentication homes, sandbox isolation, capability gaps, and pre-implementation decisions.
Historical v0 architecture and delivery plan
docs/design/hosted-subscription-connections/v0/plan.md
Describes connection records, credential storage, provider adapters, login APIs, runner routing, onboarding, concurrency controls, isolation validation, operational controls, acceptance criteria, and release boundaries.
Historical v0 interactive walkthrough
docs/design/hosted-subscription-connections/v0/architecture-walkthrough.html
Adds a standalone interactive page covering provider selection, connection states, service changes, onboarding steps, implementation gates, provider metadata, and navigation controls.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: 🟡 Moderate · up to a3ca2

This change reorganizes subscription requirements and historical design material without changing runtime behavior. However, unresolved login, policy, walkthrough, and documentation-navigation gaps could mislead future implementation work, so they should be addressed before these materials are treated as an implementation-ready contract.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the documentation updates for hosted subscription exploration and the Fable handoff.
Description check ✅ Passed The description is directly related to the changes. It explains the requirements, archived v0 proposal, research documents, handoff, validation, and the absence of runtime implementation.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/hosted-subscription-connections-plan-20260907

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mmabrouk
mmabrouk marked this pull request as ready for review September 7, 2026 12:45
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

📘 Docs preview

Status ✅ Ready
Preview https://pr-6622-agenta-docs-preview.mahmoud-637.workers.dev/docs
Inspect Actions run
Commit a3ca293fcc701bc85ea016dfd63b5b684d53f562

This comment updates in place on every push.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 7

🧹 Nitpick comments (1)
docs/design/hosted-subscription-connections/provider-policy.md (1)

9-14: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Security Misconfiguration (CWE-16)

Scope the founder confirmation.

State that written approval applies only when it covers the exact product, access method, user-owned connection, and usage mode. Keep the versioned allowlist, interactive-only schedule block, and Gemini and Anthropic OAuth blocks as hard constraints.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Team

Run ID: 547c1b63-73ad-4e41-9c02-917f4b4b6c32

📥 Commits

Reviewing files that changed from the base of the PR and between 242d95d and 319b006.

📒 Files selected for processing (7)
  • docs/design/hosted-subscription-connections/README.md
  • docs/design/hosted-subscription-connections/architecture-walkthrough.html
  • docs/design/hosted-subscription-connections/context.md
  • docs/design/hosted-subscription-connections/plan.md
  • docs/design/hosted-subscription-connections/provider-policy.md
  • docs/design/hosted-subscription-connections/research.md
  • docs/design/hosted-subscription-connections/status.md

Included review availability: Your plan provides up to 8 included reviews per hour; 5 remain after this review.

ui:"Waiting for sign-in",back:"Login attempt active",active:["web","api","runner","db","volume","provider"],
explain:"The main API creates the connection record. The runner starts the official provider client with a new private authentication home. The browser receives only a short URL and code.",
log:p=>`<span class="muted">API</span> Create user-owned ${p.label} connection<br><span class="muted">RUNNER</span> Start ${p.adapter}<br><span class="muted">MOUNT</span> Attach private ${p.home}<br><span class="warn">WAIT</span> Provider is waiting for the user`,
view:p=>`<h3>Research assistant</h3><p class="sub">New agent · Draft</p><div class="drawer"><h3>Sign in to ${p.label}</h3><p class="drawer-copy">Open the provider page and enter this one-time code. Agenta never asks you to upload a login file.</p><div class="device"><small>1. Open this provider page</small><p><strong>${p.url}</strong></p><button class="secondary">Open ${p.company}</button><small style="display:block;margin-top:13px">2. Enter this code</small><div class="code"><span>${p.code}</span><button class="copy" data-copy="${p.code}">Copy</button></div></div><div class="notice wait"><span>●</span><span><strong>Waiting for you</strong><br>You can close this page and return before the code expires.</span></div><p class="drawer-copy">${p.note}</p></div>`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Wire or relabel the action buttons.

The walkthrough renders Open ${p.company} and Cancel as buttons, but neither has a handler. The provider action does not open p.url, and the cancel action cannot change the login state.

Use an https:// link for the provider URL and a data-cancel handler, or render these controls as non-actionable examples.

Also applies to: 140-140

Comment on lines +28 to +31
The first release should support one ChatGPT connection and one SuperGrok connection per Agenta
user. A connection belongs to the user who completed the provider login. It may run only when that
same user starts an interactive agent turn. Team-triggered runs, schedules, events, and shared
connection use require a separate ownership decision.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🔎 Supported by static analysis

🤖 get_repo_knowledge executed:

get_repo_knowledge Agenta-AI/agenta /tmp/coderabbit-repo-knowledge/agenta-ai-agenta-4b53879a/conventions /tmp/coderabbit-repo-knowledge/agenta-ai-agenta-4b53879a/learnings

Length of output: 22387


🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- plan excerpts ---'
sed -n '1,270p' docs/design/hosted-subscription-connections/plan.md
printf '%s\n' '--- candidate definitions ---'
rg -n -S --glob '!node_modules' 'ConnectionsDAOInterface|interface Connection|class Connection|provider_key|integration_key|subscription_connection' .

Repository: Agenta-AI/agenta

Length of output: 50373


🏁 Script executed:

pwd
sed -n '1,270p' docs/design/hosted-subscription-connections/plan.md

Repository: Agenta-AI/agenta

Length of output: 13282


🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- relevant implementation files ---'
rg -l -S 'ConnectionsDAOInterface|class ConnectionsDAO|provider_key|integration_key' api sdks services | head -80
printf '%s\n' '--- precise symbol matches ---'
rg -n -S 'ConnectionsDAOInterface|class ConnectionsDAO|provider_key|integration_key' api/oss/src api/ee/src sdks/python/agenta 2>/dev/null | head -160
printf '%s\n' '--- plan sections and line numbers ---'
nl -ba docs/design/hosted-subscription-connections/plan.md | sed -n '24,65p;220,250p'

Repository: Agenta-AI/agenta

Length of output: 21174


🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- DAO interface ---'
sed -n '1,155p' api/oss/src/core/gateway/connections/interfaces.py
printf '%s\n' '--- connection DTOs ---'
sed -n '45,145p' api/oss/src/core/gateway/connections/dtos.py
printf '%s\n' '--- plan ownership and contract sections ---'
awk 'NR>=45 && NR<=62 || NR>=228 && NR<=248 {printf "%d:%s\n", NR, $0}' docs/design/hosted-subscription-connections/plan.md

Repository: Agenta-AI/agenta

Length of output: 7890


Define the canonical ownership scope and field mapping.

The proposed subscription_connection is workspace-scoped, but the first release limits connections per Agenta user. Repository conventions require tenant scoping by project_id, and ConnectionsDAOInterface.create_connection requires both project_id and user_id. The existing Connection DTO uses provider_key and integration_key, while this design introduces provider, product, and auth_source.

Specify whether this is a separate resource or an extension of gateway_connections. Then define its uniqueness scope and the project/workspace/owner and field mappings. Otherwise, creation, ownership checks, and run resolution can use different records or scopes.

Comment on lines +141 to +144
Starting a login is idempotent while one non-expired attempt exists. The server returns the active
attempt instead of launching a second provider process. Disconnect first marks the connection
unusable for new runs, then stops active login work, calls the provider logout command, and destroys
the authentication home.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Restrict idempotency to non-terminal login attempts.

The rule currently uses “one non-expired attempt.” A failed, cancelled, or other terminal attempt can remain unexpired, so a retry can return a terminal attempt instead of starting new work. This conflicts with Lines 225-227, which promise Try again.

Define idempotency for starting, waiting_for_user, and exchanging only. Allow a new attempt after failed, expired, or cancelled.

Proposed contract clarification
- Starting a login is idempotent while one non-expired attempt exists.
+ Starting a login is idempotent while one attempt in
+ starting, waiting_for_user, or exchanging exists.
+ Terminal attempts can be replaced by a new login attempt.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Starting a login is idempotent while one non-expired attempt exists. The server returns the active
attempt instead of launching a second provider process. Disconnect first marks the connection
unusable for new runs, then stops active login work, calls the provider logout command, and destroys
the authentication home.
Starting a login is idempotent while one attempt in
starting, waiting_for_user, or exchanging exists.
Terminal attempts can be replaced by a new login attempt. The server returns the active
attempt instead of launching a second provider process. Disconnect first marks the connection
unusable for new runs, then stops active login work, calls the provider logout command, and destroys
the authentication home.

Comment on lines +187 to +189
The runner reports completion to the main API through an authenticated internal callback. The
frontend polls the main API. This lets onboarding survive a page refresh and keeps the browser away
from runner addresses and credentials.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🤖 get_repo_knowledge executed:

get_repo_knowledge Agenta-AI/agenta /tmp/coderabbit-repo-knowledge/agenta-ai-agenta-4b53879a/learnings /tmp/coderabbit-repo-knowledge/agenta-ai-agenta-4b53879a/conventions

Length of output: 10940


🏁 Script executed:

#!/bin/bash
sed -n '115,220p' docs/design/hosted-subscription-connections/plan.md

Repository: Agenta-AI/agenta

Length of output: 5573


🏁 Script executed:

#!/bin/bash
rg -n -C 3 "callback|completion|attempt_id|generation|lease|cancel|disconnect|DELETE|ready" docs/design/hosted-subscription-connections/plan.md

Repository: Agenta-AI/agenta

Length of output: 10016


🏁 Script executed:

#!/bin/bash
# Inspect the design file structure and the exact callback/lease sections.
ast-grep outline docs/design/hosted-subscription-connections/plan.md 2>/dev/null || true

Repository: Agenta-AI/agenta

Length of output: 220


🏁 Script executed:

#!/bin/bash
sed -n '35,95p;220,250p' docs/design/hosted-subscription-connections/plan.md

Repository: Agenta-AI/agenta

Length of output: 3930


🏁 Script executed:

#!/bin/bash
rg -n -C 2 "callback|generation|nonce|attempt|state transition|stale|replay|idempotent|cancelled|disconnected" docs/design/hosted-subscription-connections

Repository: Agenta-AI/agenta

Length of output: 11884


Authorization Bypass (CWE-863): Incorrect Authorization

Reachability: Internal · Exploitability: Difficult

Fence completion callbacks against cancellation and replay.

The callback is authenticated, but authentication does not prove callback freshness. Include connection_id, attempt_id, and a callback nonce or generation. Reject completions for cancelled, disconnected, expired, or superseded attempts, and make the state transition idempotent.

Comment on lines +206 to +209
Use a short database lease, a time-limited ownership record, to claim one connection for a run.
Include a monotonically increasing lease generation number in the runner request. The runner
rejects work from an older generation, so a delayed process cannot write credentials after a newer
lease or disconnect. Release the lease on normal completion. Let it expire after a worker crash.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

🔎 Supported by static analysis

🏁 Script executed:

sed -n '180,220p' docs/design/hosted-subscription-connections/plan.md
printf '\n--- related design sections ---\n'
sed -n '20,70p;120,150p;175,210p;220,255p' docs/design/hosted-subscription-connections/plan.md

Repository: Agenta-AI/agenta

Length of output: 9351


🤖 get_repo_knowledge executed:

get_repo_knowledge Agenta-AI/agenta /tmp/coderabbit-repo-knowledge/agenta-ai-agenta-4b53879a/conventions /tmp/coderabbit-repo-knowledge/agenta-ai-agenta-4b53879a/learnings

Length of output: 17069


Define lease renewal and atomic fencing.

The first-release rule allows one owner, but the short lease has no renewal or atomic claim semantics. If a healthy turn outlives the lease, another run can claim and mount the same writable authentication home. Apply fencing to every runner operation, and invalidate the generation on cancellation, disconnect, and expiry.

Comment on lines +79 to +82
This gives Agenta a stable control interface. Agenta should run the official Codex binary in a
private authentication worker and relay only the verification URL, one-time code, expiry, and
sanitized completion state to the browser. Agenta does not need to implement OpenAI's private OAuth
exchange or parse terminal text.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🔎 Supported by static analysis

🤖 get_repo_knowledge executed:

get_repo_knowledge Agenta-AI/agenta /tmp/coderabbit-repo-knowledge/agenta-ai-agenta-4b53879a/learnings /tmp/coderabbit-repo-knowledge/agenta-ai-agenta-4b53879a/conventions

Length of output: 36336


🏁 Script executed:

#!/bin/bash
set -eu
file='docs/design/hosted-subscription-connections/research.md'
printf '%s\n' '--- target excerpt ---'
sed -n '60,90p' "$file"
printf '%s\n' '--- nearby login and provider references ---'
rg -n -C 3 'chatgptDeviceCode|expiry|verificationUrl|userCode|account/login/start|Codex' "$file"

Repository: Agenta-AI/agenta

Length of output: 4394


🏁 Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- exact source references ---'
rg -n -C 5 'chatgptDeviceCode|verificationUrl|userCode|expiry|account/login/start' docs/design/hosted-subscription-connections/research.md

Repository: Agenta-AI/agenta

Length of output: 2222


🌐 Web query:

OpenAI Codex app-server account/login/start chatgptDeviceCode loginId verificationUrl userCode expiry official documentation

💡 Result:

OpenAI Codex provides a device code authentication flow (beta) designed specifically for headless devices or environments where a standard browser-based login is impractical [1][2]. Workflow and Verification To initiate the device code login, you can run the command codex login --device-auth in your terminal or select the "Sign in with Device Code" option within the interactive login interface [1][2]. When this flow is initiated, the application requests a device code from the OpenAI authentication server [3][4]. The server returns a payload containing [3][5]: - userCode: A one-time code to be entered by the user [3][5]. - verificationUrl: The URL (typically https://auth.openai.com/codex/device) where the user must navigate to enter the code [3][5][6]. - deviceAuthId: An identifier used internally by the client to poll for the authentication token [3][5]. The client then periodically polls the OpenAI token endpoint while waiting for the user to complete the verification in their browser [3][5][6]. Once the user successfully logs in and enters the code, the client receives the necessary credentials to complete the session [1][5]. Important Implementation Notes - Availability: If device code login is not explicitly enabled or supported for a specific server or configuration, the client will typically receive a 404 error, prompting a fallback to the standard browser-based login flow [7][3][8]. - Expiry: While specific timeout durations may vary by implementation, device code sessions typically have a defined expiration (e.g., 15 minutes) [6]. - Administration: In managed environments, administrators may restrict login methods or require specific workspace IDs, which can impact the availability of the device code flow [9][2][7]. For further integration or specific development needs, you can refer to the official Codex CLI documentation or the open-source repository [1][10]. Note that Codex and its associated models are subject to regular updates and deprecations; please consult the official changelog for the most current information regarding model support and CLI features [11][12][13].

Citations:


🏁 Script executed:

#!/bin/bash
set -eu
base='https://raw.githubusercontent.com/openai/codex/main/codex-rs/app-server/README.md'
device='https://raw.githubusercontent.com/openai/codex/main/codex-rs/login/src/device_code_auth.rs'
printf '%s\n' '--- official app-server auth endpoint ---'
curl -fsSL "$base" | rg -n -C 12 'chatgptDeviceCode|account/login/start|verificationUrl|userCode|expiry|loginId'
printf '%s\n' '--- official device-code implementation fields ---'
curl -fsSL "$device" | rg -n -C 6 'user_code|verification_url|device_auth|expires|expiry|DeviceCode'

Repository: Agenta-AI/agenta

Length of output: 245


🏁 Script executed:

#!/bin/bash
set -eu
api='https://api.github.com/repos/openai/codex/contents/codex-rs/app-server'
printf '%s\n' '--- app-server directory entries ---'
curl -fsSL "$api" | python3 -c '
import json, sys
for item in json.load(sys.stdin):
    print(item["type"], item["path"], item["download_url"] or "")
'

Repository: Agenta-AI/agenta

Length of output: 491


🏁 Script executed:

#!/bin/bash
set -eu
tree='https://api.github.com/repos/openai/codex/git/trees/main?recursive=1'
curl -fsSL "$tree" |
  python3 -c '
import json, sys
data=json.load(sys.stdin)
for item in data["tree"]:
    p=item["path"]
    if p.startswith("codex-rs/app-server/") and p.endswith((".rs",".md")):
        print(p)
' | head -80

Repository: Agenta-AI/agenta

Length of output: 4528


🏁 Script executed:

#!/bin/bash
set -eu
for path in \
  codex-rs/app-server/src/request_processors/account_processor.rs \
  codex-rs/app-server/src/models.rs \
  codex-rs/app-server/src/outgoing_message.rs
do
  printf '\n--- %s ---\n' "$path"
  curl -fsSL "https://raw.githubusercontent.com/openai/codex/main/$path" |
    rg -n -C 10 'chatgptDeviceCode|verification_url|verificationUrl|user_code|userCode|login_id|loginId|expiry|expires'
done

Repository: Agenta-AI/agenta

Length of output: 11570


Define the Codex login expiry contract.

The Codex app-server constructs ChatgptDeviceCode responses with only login_id, verification_url, and user_code. The plan must define expiry as an Agenta-owned deadline or make it optional. Do not require the adapter to populate a provider field that does not exist.

Comment on lines +109 to +111
If none exists, the first version can pin one Grok CLI release and parse its terminal output behind
a provider adapter. This must remain an explicit compatibility dependency with an end-to-end login
test before every CLI upgrade.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🔎 Supported by static analysis

🤖 get_repo_knowledge executed:

get_repo_knowledge Agenta-AI/agenta /tmp/coderabbit-repo-knowledge/agenta-ai-agenta-4b53879a/conventions /tmp/coderabbit-repo-knowledge/agenta-ai-agenta-4b53879a/learnings

Length of output: 16383


🏁 Script executed:

#!/bin/bash
set -eu
file='docs/design/hosted-subscription-connections/research.md'
sed -n '90,125p' "$file"
printf '\n--- nearby provider references ---\n'
rg -n -C 3 'Grok|grok|auto-update|device-auth|agent stdio|provider adapter' "$file"

Repository: Agenta-AI/agenta

Length of output: 4724


🌐 Web query:

site:docs.x.ai/build/cli/headless-scripting Grok CLI --no-auto-update ACP automation

💡 Result:

The --no-auto-update flag for the Grok CLI is used to prevent the CLI from performing background update checks when running in automated or script-based environments [1]. This is particularly important for headless operations and ACP (Agent Communication Protocol) usage, such as when running grok agent stdio [1]. To use this flag, you can pass it directly in your command: grok --no-auto-update -p "your prompt here" Alternatively, you can persistently disable auto-updates by adding the following to your configuration file at ~/.grok/config.toml [1]: [cli] auto_update = false

Citations:


🌐 Web query:

site:docs.x.ai/build/cli/headless-scripting "grok agent stdio" "--no-auto-update"

💡 Result:

The command grok agent stdio is a feature of the x.ai CLI used to run Grok as an Automated Communication Protocol (ACP) agent [1]. It communicates via JSON-RPC over standard input (stdin) and standard output (stdout), allowing developers to integrate Grok into scripts, CI/CD pipelines, or IDE tools rather than using a standard interactive terminal session [1]. The --no-auto-update flag is used to disable background update checks [1]. This is recommended when running the agent in headless, automated, or script-based environments to prevent update checks from interfering with standard output or causing unexpected delays [1]. To use it, you can execute: grok agent stdio --no-auto-update Alternatively, you can persistently disable automatic updates by setting auto_update = false under the [cli] section in your ~/.grok/config.toml file [1].

Citations:


🌐 Web query:

site:docs.x.ai/build/cli/reference grok agent stdio no-auto-update global option

💡 Result:

To disable the automatic update check for the Grok agent, you can use the environment variable GROK_DISABLE_AUTOUPDATER or configure the auto_update setting in your Grok configuration file [1]. Environment Variable: Setting the environment variable GROK_DISABLE_AUTOUPDATER will suppress the auto-updater for that specific process, which is recommended for CI or containerized environments [1]. Configuration File: In your Grok configuration file (e.g., ~/.grok/config.toml), you can disable the check by setting auto_update to false within the [cli] section [1]: [cli] auto_update = false Note that while your query mentioned "no-auto-update," the official configuration parameter is named auto_update (as a boolean) and the environment variable is named GROK_DISABLE_AUTOUPDATER [1]. There is no global command-line flag named --no-auto-update [2].

Citations:


🏁 Script executed:

#!/bin/bash
set -eu
for url in \
  'https://docs.x.ai/build/cli/headless-scripting' \
  'https://docs.x.ai/build/cli/reference' \
  'https://docs.x.ai/build/settings/reference'
do
  echo "=== $url ==="
  curl -L --fail --silent --show-error "$url" |
    tr '\n' ' ' |
    sed 's/<[^>]*>/ /g' |
    grep -Eo '.{0,220}(no-auto-update|GROK_DISABLE_AUTOUPDATER|auto_update|agent stdio).{0,320}' |
    head -20 || true
done

Repository: Agenta-AI/agenta

Length of output: 5637


Disable Grok self-updates in the pinned fallback.

If the adapter runs grok agent stdio, disable update checks with --no-auto-update, GROK_DISABLE_AUTOUPDATER, or [cli] auto_update = false. Add this requirement to the acceptance criteria. Verify the exact invocation for the pinned release.

@mmabrouk mmabrouk changed the title [docs] Plan hosted subscription connections [docs] Define hosted subscription connection design Sep 7, 2026
@mmabrouk mmabrouk changed the title [docs] Define hosted subscription connection design [docs] Separate subscription requirements from the v0 proposal Sep 8, 2026
@mmabrouk

mmabrouk commented Sep 8, 2026

Copy link
Copy Markdown
Member Author

🤖 The AI agent says:

Updated this PR from Mahmoud's requirements discussion:

  • Moved the original proposal and walkthrough under v0/, marked as a good starting point that may miss requirements and design questions.
  • Added requirements.md containing only the user's requirements, edited for clarity.
  • Added technical-inferences.md with a clear disclaimer and an audit removing premature architecture choices.
  • Added design-questions.md; no replacement implementation plan is selected.

The first version needs ChatGPT through either Codex or Pi, concurrent sessions, multiple agents, and natural project or organization scope. Grok is deferred. The main questions are harness feasibility, concurrent renewal and crash recovery, cloud credential isolation, scope permissions, persistence and routing, lifecycle behavior, and the boundaries needed for Grok later.

Please review the requirements for fidelity and the inferences for remaining assumptions. The suggested first investigation is a login-to-refresh proof with one harness under concurrent sessions, before selecting storage or service ownership.

Validation: relative Markdown links and whitespace pass; archived source content is preserved.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Advanced

Run ID: 933ab947-4604-4090-bf91-349445c18be3

📥 Commits

Reviewing files that changed from the base of the PR and between 8105823 and a8abc8f.

📒 Files selected for processing (10)
  • docs/design/hosted-subscription-connections/README.md
  • docs/design/hosted-subscription-connections/design-questions.md
  • docs/design/hosted-subscription-connections/requirements.md
  • docs/design/hosted-subscription-connections/technical-inferences.md
  • docs/design/hosted-subscription-connections/v0/README.md
  • docs/design/hosted-subscription-connections/v0/architecture-walkthrough.html
  • docs/design/hosted-subscription-connections/v0/context.md
  • docs/design/hosted-subscription-connections/v0/plan.md
  • docs/design/hosted-subscription-connections/v0/research.md
  • docs/design/hosted-subscription-connections/v0/status.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/design/hosted-subscription-connections/README.md

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Comment on lines +19 to +24
1. [architecture-walkthrough.html](architecture-walkthrough.html) shows the onboarding and backend
flow together in an interactive walkthrough.
2. [context.md](context.md) explains what Agenta already supports and what remains missing.
3. [research.md](research.md) maps the proposal to current code.
4. [plan.md](plan.md) defines the recommended implementation and delivery order.
5. [status.md](status.md) records open decisions and the current state.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Put current requirements first in the reading order.

The first link opens the unapproved v0 architecture. This conflicts with the disclaimer above and can cause readers to treat historical choices as current design. Link to ../requirements.md and ../design-questions.md before the v0 walkthrough and plan.

Suggested reading-order update
 ## Reading order
-1. [architecture-walkthrough.html](architecture-walkthrough.html) shows the onboarding and backend
-   flow together in an interactive walkthrough.
-2. [context.md](context.md) explains what Agenta already supports and what remains missing.
-3. [research.md](research.md) maps the proposal to current code.
-4. [plan.md](plan.md) defines the recommended implementation and delivery order.
-5. [status.md](status.md) records open decisions and the current state.
+1. [current requirements](../requirements.md)
+2. [open design questions](../design-questions.md)
+3. [architecture-walkthrough.html](architecture-walkthrough.html) shows the historical onboarding
+   and backend flow together in an interactive walkthrough.
+4. [context.md](context.md) explains what Agenta already supports and what remains missing.
+5. [research.md](research.md) maps the proposal to current code.
+6. [plan.md](plan.md) defines the historical implementation order.
+7. [status.md](status.md) records open decisions and the historical state.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
1. [architecture-walkthrough.html](architecture-walkthrough.html) shows the onboarding and backend
flow together in an interactive walkthrough.
2. [context.md](context.md) explains what Agenta already supports and what remains missing.
3. [research.md](research.md) maps the proposal to current code.
4. [plan.md](plan.md) defines the recommended implementation and delivery order.
5. [status.md](status.md) records open decisions and the current state.
1. [current requirements](../requirements.md)
2. [open design questions](../design-questions.md)
3. [architecture-walkthrough.html](architecture-walkthrough.html) shows the historical onboarding
and backend flow together in an interactive walkthrough.
4. [context.md](context.md) explains what Agenta already supports and what remains missing.
5. [research.md](research.md) maps the proposal to current code.
6. [plan.md](plan.md) defines the historical implementation order.
7. [status.md](status.md) records open decisions and the historical state.

@mmabrouk mmabrouk changed the title [docs] Separate subscription requirements from the v0 proposal [docs] Prepare hosted subscription exploration and Fable handoff Sep 8, 2026
@mmabrouk

mmabrouk commented Sep 8, 2026

Copy link
Copy Markdown
Member Author

🤖 The AI agent says:

Added the working research and editable Fable handoff from Mahmoud's latest direction. The endpoint is now an integrated exploratory implementation, with parallel spikes and no timebox. Session-owned refresh is the leading hypothesis; shared mounts, database-backed state, and publication/reload hooks are candidates. A single authentication-owning process is the last option. UI re-login is part of the exploration, and Grok implementation is excluded.

Created /home/mahmoud/code/agenta-2-worktrees/hosted-subscriptions on local branch spike/hosted-subscription-exploration, starting from this PR. Added working-research.md, fable-prompt.md, communication-log.md, and status.md. The log supports asynchronous relay when Fable and Codex do not share a filesystem.

Mahmoud can edit and send the prompt; Codex has not contacted Fable. The original requirements and v0 archive remain unchanged. Relative Markdown links and whitespace checks pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant