DEV Community

Cover image for Codex CLI से osFoundry के agent, team या loop session को task कैसे सौंपें
BBT for BBT हिन्दी

Posted on

Codex CLI से osFoundry के agent, team या loop session को task कैसे सौंपें

यह सब हो जाने के बाद Codex CLI ऐसा काम, जो उसे ख़ुद नहीं करना चाहिए, osFoundry के किसी session को सौंप सकता है: agent session, team session या loop। वह एक goal, अब तक जो उसे पता है उसका summary, और जो output उसे वापस चाहिए, वह भेजता है। Session के owner को notification मिलता है और वह Accept and run (स्वीकार करें और चलाएँ) या Decline (अस्वीकार करें) पर click करता है। Run पूरा होने के बाद Codex उसी terminal session में result पढ़ता है और आगे काम करता है। अगर आप उसे Runner seat दे दें, तो वह बिना किसी click के ख़ुद एक सीमित run शुरू कर सकता है।

कौन क्या करता है

Codex CLI osFoundry
Login आपका अपना Codex sign-in। osFoundry का OAuth token Codex के पास रहता है Connection को एक बार approve करता है, एक workspace और आपके चुने हुए scopes के लिए
किन चीज़ों तक पहुँच जिन sessions में उसे invite किया गया है, सात *_session_* tools के ज़रिए Seat तय करती है: Viewer पढ़ता है, Contributor notes post करता है और handoff propose करता है, Runner runs भी request कर सकता है
काम कौन करता है Codex आपकी repository में काम करता रहता है Session अपने agent runtime पर चलता है, अपने agents, tools और model settings के साथ
Approve कौन करता है हर write tool से पहले Codex आपसे पूछता है (default_tools_approval_mode = "writes") Handoff session owner के Accept and run का इंतज़ार करता है। Runner seat request_session_run के लिए स्थायी approval है
कितनी देर चलता है Call में max_rounds 1 से 10 Owner को "Up to N rounds on your agent runtime" के रूप में दिखता है
वापस क्या आता है इस connection से शुरू हुए tasks का status और result, और उसे भेजे गए notes Session के agents का internal analysis osFoundry के अंदर ही रहता है

Setup

1. Connection बनाएँ

osFoundry में header के key icon पर click करें और Connected tab ("Connected agents") खोलें। "Connect in three steps" में Assistant को Other MCP client पर सेट करें, Codex CLI जैसा कोई display name दें और Add assistant पर click करें। Owner हर handoff पर यही नाम देखेगा, इसलिए ऐसा नाम रखें जिसे वह पहचान सके।

Codex CLI connection के साथ Connected agents tab

उदाहरण: Codex CLI connection के साथ Connected agents tab

2. Run scope के साथ server को Codex में जोड़ें

codex mcp add osfoundry --url https://api.osfoundry.io/api/v1/external-mcp
Enter fullscreen mode Exit fullscreen mode

फिर ~/.codex/config.toml खोलें और table को उतना ही रखें जितना इस काम के लिए ज़रूरी है:

[mcp_servers.osfoundry]
url = "https://api.osfoundry.io/api/v1/external-mcp"
scopes = ["osfoundry:read", "osfoundry:write", "osfoundry:run"]
default_tools_approval_mode = "writes"
enabled_tools = [
  "list_granted_resources",
  "list_project_resources",
  "read_session_state",
  "read_session_task_result",
  "read_session_mail",
  "post_session_note",
  "propose_session_handoff",
  "cancel_session_handoff",
  "request_session_run",
]
Enter fullscreen mode Exit fullscreen mode

request_session_run के पीछे का scope osfoundry:run है। अगर Codex को सिर्फ़ propose करना है, तो इसे हटा दें। Handoff और note tools को osfoundry:write चाहिए, तीनों reader tools को osfoundry:read। "writes" के साथ Codex उन चार tools से पहले पूछता है जो read-only marked नहीं हैं, और readers को बिना पूछे चला देता है।

3. Sign in करें

codex mcp login osfoundry
Enter fullscreen mode Exit fullscreen mode

Browser में osFoundry का "Connect an agent" page खुलता है। ऊपर वाले scopes के साथ "Requested capabilities" में तीन lines दिखती हैं। तीसरी line है "Run sessions where you grant a runner role"। Workspace चुनें, "Use pending: Codex CLI" select करें, approval box पर tick करें और Connect पर click करें।

4. Connection को उस project में जोड़ें जिसमें session है

Connected tab में वापस आने पर connection के आगे "Connected." लिखा होता है। Projects में project चुनें और Add to project पर click करें। इससे connection उस project के eligible sessions देख पाता है। अभी वह उनमें से किसी में write नहीं कर सकता।

एक जोड़े गए project के साथ Projects section

उदाहरण: एक जोड़े गए project के साथ Projects section

5. Session में उसे एक seat दें

नीचे "Agent, Team, and Loop sessions" है। Help line सब कुछ बता देती है: "Invite it to a session as Contributor to post notes and propose handoffs, or Runner to also request runs. A handoff still needs the session owner's approval."

Agent, Team, and Loop sessions
  [ Team session ▾ ]  [ Release desk ▾ ]  [ Contributor ▾ ]  [ Save role ]
Enter fullscreen mode Exit fullscreen mode

Agent, Team, and Loop sessions section, जिसमें Codex CLI एक team session में Contributor है

उदाहरण: Agent, Team, and Loop sessions section, जिसमें Codex CLI एक team session में Contributor है

Session list में सिर्फ़ उन projects के sessions आते हैं जिनमें यह connection जोड़ा गया है। Type, session और role चुनें, फिर Save role पर click करें। शुरुआत Contributor से करें। बाद में उसी session के लिए Runner save करने पर role बदल जाता है।

एक असली run

जिस machine पर यह लिखा गया, उस पर Codex install नहीं है, इसलिए नीचे वाला session एक simulated उदाहरण है। Tool names और argument names वही हैं जो live server tools/list से लौटाता है, उस mcp__osfoundry__ prefix के साथ जो Codex MCP tools पर लगाता है। Repository, session और सारी values demo content हैं।

Example (simulated)

> The CSV export fix is merged. Hand the customer note and the KB update
  to the osFoundry Release desk team, then tell me what they wrote.

• mcp__osfoundry__list_granted_resources {}
  ← 1 project: "Billing v2"
• mcp__osfoundry__list_project_resources {"project_id": "…", "resource_type": "team_session",
      "search": "release"}
  ← team_session "Release desk"
• mcp__osfoundry__propose_session_handoff {
      "session_type": "team_session", "session_id": "…",
      "goal": "Write the customer note for the CSV export fix and update the KB article on exports.",
      "context_summary": "Exports over 10k rows were cut at 10,000. Fixed in PR #212 (streams rows, no cap). Affects plans with scheduled exports. No data was lost; re-running an export now returns all rows.",
      "requested_output": "Draft note (<120 words) and the KB article diff, for review.",
      "max_rounds": 4, "idempotency_key": "codex-csv-212-note"}
  [Codex asks: allow this tool call? → yes]
  ← handoff pending owner review

  (in osFoundry the owner opens "Codex CLI requests a handoff" → Review handoff
   → Handoffs → Outside assistant requests → Accept and run)

• mcp__osfoundry__read_session_state {"session_type": "team_session", "session_id": "…"}
  ← running, recent task "Requested by an outside assistant"
• mcp__osfoundry__read_session_task_result {"session_type": "team_session",
      "session_id": "…", "task_id": "…"}
  ← completed: draft note + KB diff
• mcp__osfoundry__post_session_note {"session_type": "team_session", "session_id": "…",
      "subject": "Thanks, one correction",
      "body": "The fix shipped in 3.18.2, not 3.18.1.", "idempotency_key": "codex-csv-212-fix"}
  [Codex asks: allow this tool call? → yes]

The Release desk drafted a 96-word note and a KB diff that replaces the
"exports are capped at 10,000 rows" paragraph. I posted a version
correction back to the session.
Enter fullscreen mode Exit fullscreen mode

Owner की तरफ़ काम छोटा है। Notification में "Codex CLI requests a handoff" के साथ "Review the request in Release desk." और एक Review handoff button होता है। वह session का Handoffs tab खोलता है। "Outside assistant requests" में goal पूरा दिखता है, "Context and expected output" खोलकर देखा जा सकता है, और "Up to 4 rounds on your agent runtime" वाली line बताती है कि run कितना कर सकता है। Accept and run उसे queue में डाल देता है ("Handoff accepted and run queued")। Decline उसे वहीं ख़त्म कर देता है।

Codex CLI requests a handoff notification और उसका Review handoff button

उदाहरण: Codex CLI requests a handoff notification और उसका Review handoff button

Session के Handoffs tab में pending outside assistant request, Accept and run और Decline के साथ

उदाहरण: Session के Handoffs tab में pending outside assistant request, Accept and run और Decline के साथ

अगर Codex ने ग़लत चीज़ भेज दी, तो handoff_id के साथ cancel_session_handoff उसे वापस ले लेता है, बशर्ते owner ने अभी accept न किया हो।

सीमा कहाँ है

Proposal और run जान-बूझकर दो अलग tools हैं। propose_session_handoff किसी इंसान से पूछता है। इसके लिए osfoundry:write, Contributor seat, और इंसान के पढ़ने लायक़ context_summary और requested_output चाहिए, और owner के click करने तक कुछ शुरू नहीं होता। request_session_run click को skip करता है। इसके लिए osfoundry:run और Runner seat चाहिए, जो owner ने पहले से दी है, यानी click एक बार हो चुका है, seat देते समय। दोनों max_rounds को 10 पर सीमित करते हैं। Proposal goal को 5,000 characters पर सीमित करता है, run 10,000 पर।

Codex को results दिखते हैं, reasoning नहीं। read_session_task_result सिर्फ़ वही tasks लौटाता है जो इस connection ने शुरू किए। read_session_mail connection को भेजे गए notes और उसके ख़ुद post किए notes लौटाता है, और tool description में लिखा है "Internal agent analysis is excluded."। post_session_note नाम के साथ एक note जोड़ता है जिसका जवाब session के agents दे सकते हैं, और यह "does not trigger an automatic run"।

Session वहीं चलता है जहाँ वह हमेशा चलता है। Handoff Codex का model, keys या repository osFoundry में नहीं ले जाता। वह text ले जाता है, और session अपने agents और tools से काम करता है। जो कुछ सिर्फ़ desktop पर local है, जैसे कोई local folder या unsynced item, वह पहुँच से बाहर रहता है। Server का initialize reply भी यही कहता है: "Local-only data is unavailable to cloud clients."

Access हटाना एक click का काम है। Connected tab में seat हटा दें या connection revoke कर दें, और Codex की अगली session call refuse हो जाएगी।

पहली बार आज़माने के लिए ऐसा loop अच्छा है जिसे आप अभी हाथ से चलाते हैं। Codex CLI को उसमें Contributor के रूप में invite करें, अपनी repository में कोई change पूरा करें, और Codex से कहें कि वह क्या बदला उसके summary के साथ loop का अगला run propose करे। Handoffs दिखाता है कि osFoundry के अपने agents steps के बीच context कैसे आगे बढ़ाते हैं, और agent sessions दिखाता है कि Handoffs tab कहाँ है।

Top comments (0)