Skip to content

Embed native Onyx Chat in Twenty with authorized record context - #131

Merged
aviyashchin merged 4 commits into
mainfrom
agent/codex-twenty-panel-9
Nov 2, 2026
Merged

aviyashchin merged 4 commits into
mainfrom
agent/codex-twenty-panel-9

Conversation

@aviyashchin

@aviyashchin aviyashchin commented Nov 2, 2026 •

Copy link
Copy Markdown

Summary

Twenty #9 needs native Onyx Chat in the existing CRM drawer, including attachments and current record permissions. Paired with https://github.com/Subconscious-ai/twenty/pull/7 and market-ontology onyx-dot-app#539.

Twenty drawer
  existing memory-only host-auth bridge
  native AppPage + composer + uploads + history search
    send-time Twenty context ID + native file_descriptors
      fixed Twenty authorization callback
        native private chat + encrypted source references

Reuse native upload, file-access, streaming, cancellation, retry, and history owners. Recheck record access on sends and history reads/search. Keep record-bound conversations private; serialize sharing/project moves against context binding. Preserve the embed route through native conversation navigation. No new schema or service.

Evidence

Candidate head: bb9f25e1db13c2012a05553414719b62a6251dd6.

  • Before: native first-send navigation escaped /causl into /app; Twenty's drawer still used its own composer and the backend execution path forwarded text only.
    After: the embed-navigation regression passes; native file_descriptors and twenty_context_id reach the send request. Transport and host-auth Jest: 11 passed.
  • Backend context/host-auth/HTTP tests: 72 passed, including identity mismatch, denied callback, redirect refusal, successive records, and sharing recheck after an in-flight binding.
  • Web direct type check: node node_modules/typescript-7/bin/tsc --noEmit --project tsconfig.types.json exited 0. Changed Python Ruff check/format exited 0. Changed web Oxlint exited 0 with existing-file warnings; the new TwentyChat file has no warnings.
  • Independent Standards review: no remaining hard violations; one pre-existing-PR host-session type duplication observation in Twenty. Independent Spec review: native UI and attachment transport implemented; staff acceptance remains P1.
  • Unproved: actual staff login, attachment-supported answer, citations, reopened history, revocation, logout/account switch, and visual acceptance on the candidate runtime. Current running Twenty is stock v2.50.0; the running Onyx API has neither CAUSL_KB_HOST_AUTH_ENABLED nor TWENTY_PANEL_ORIGIN configured. No production configuration changed.

Hosted checks, including review / Claude review, did not start: GitHub reports "The job was not started because your account is locked due to a billing issue." The inspected review and quality jobs have no runner or steps. Independent agent review is recorded above; hosted CI is not green.

Final independent Standards and Spec code reviews pass on both exact heads. Search and attachment reading remain available. File export, image generation, custom actions, and saved-memory writes are unavailable for record-bound Twenty turns. History checks release database connections, run concurrently, and reject late responses. The timeout does not guarantee strict 15-second completion. Whole-repository Python types pass with the lockfile-pinned packages.

Merge Danger

Door: one-way

Authentication and record authorization cross application boundaries. Requires paired Twenty changes, existing host-auth/allowed-origin configuration, and TWENTY_PANEL_ORIGIN set to the trusted Twenty origin. The owner approved push and merge on 2026-11-02. Staff acceptance remains pending. No migration, paid model fallback, or deployment is included.

Blast Radius: authentication

@aviyashchin
aviyashchin marked this pull request as ready for review November 2, 2026 13:05
@aviyashchin

Copy link
Copy Markdown
Author

Final local gate: bb9f25e1db13c2012a05553414719b62a6251dd6. The worktree was clean at gate start.

GitHub Actions cannot start on this head. The review job has no runner or steps. Annotation: "The job was not started because your account is locked due to a billing issue." The owner-approved 2026-10-31 local-gate exception applies.

Independent reviewers pareto_standards_review and pareto_spec_review both pass this exact head and Twenty 1d176fe76cb7912c3d93e6744fb95126108fa689. No blocking code finding remains. There are no review threads. The owner approved merge on 2026-11-02.

Command (cwd /home/ubuntu/subconscious-ai/onyx/.worktrees/twenty-panel-9), exit 0:

/tmp/539-onyx-gate/bin/ty check --python /tmp/539-onyx-gate --output-format concise
All checks passed!

Command (cwd /home/ubuntu/subconscious-ai/onyx/.worktrees/twenty-panel-9), exit 0:

/home/ubuntu/subconscious-ai/onyx/.venv/bin/ruff check backend/onyx/chat/process_message.py backend/onyx/db/chat.py backend/onyx/db/chat_search.py backend/onyx/db/twenty_panel.py backend/onyx/prompts/twenty.py backend/onyx/server/features/projects/api.py backend/onyx/server/query_and_chat/causl/models.py backend/onyx/server/query_and_chat/causl/twenty.py backend/onyx/server/query_and_chat/models.py backend/onyx/tools/tool_constructor.py backend/tests/unit/onyx/chat/test_chat_utils.py backend/tests/unit/onyx/llm/test_factory.py backend/tests/unit/onyx/server/test_twenty_panel.py
All checks passed!

Command (cwd /home/ubuntu/subconscious-ai/onyx/.worktrees/twenty-panel-9), exit 0:

/home/ubuntu/subconscious-ai/onyx/.venv/bin/ruff format --check backend/onyx/chat/process_message.py backend/onyx/db/chat.py backend/onyx/db/chat_search.py backend/onyx/db/twenty_panel.py backend/onyx/prompts/twenty.py backend/onyx/server/features/projects/api.py backend/onyx/server/query_and_chat/causl/models.py backend/onyx/server/query_and_chat/causl/twenty.py backend/onyx/server/query_and_chat/models.py backend/onyx/tools/tool_constructor.py backend/tests/unit/onyx/chat/test_chat_utils.py backend/tests/unit/onyx/llm/test_factory.py backend/tests/unit/onyx/server/test_twenty_panel.py
13 files already formatted

Command (cwd /home/ubuntu/subconscious-ai/onyx/.worktrees/twenty-panel-9), exit 0:

env PYTHONPATH=backend /tmp/539-onyx-gate/bin/python -m pytest -q backend/tests/unit/onyx/server/test_twenty_panel.py backend/tests/unit/onyx/auth/test_host_auth.py backend/tests/unit/onyx/server/test_causl_workspace_http.py backend/tests/unit/onyx/chat/test_chat_utils.py backend/tests/unit/onyx/llm/test_factory.py
........................................................................ [100%]
=============================== warnings summary ===============================
../../.venv/lib/python3.13/site-packages/fastapi/testclient.py:1
  /home/ubuntu/subconscious-ai/onyx/.venv/lib/python3.13/site-packages/fastapi/testclient.py:1: StarletteDeprecationWarning: Using `httpx` with `starlette.testclient` is deprecated; install `httpx2` instead.
    from starlette.testclient import TestClient as TestClient  # noqa

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
72 passed, 1 warning in 6.72s

Command (cwd /home/ubuntu/subconscious-ai/onyx/.worktrees/twenty-panel-9/web), exit 0:

node node_modules/jest/bin/jest.js --runInBand src/lib/causl/transport.test.ts src/lib/causl/host-auth.test.ts src/sections/sidebar/ChatSearchCommandMenu.test.tsx

Test Suites: 3 passed, 3 total
Tests:       11 passed, 11 total
Snapshots:   0 total
Time:        4.914 s, estimated 20 s
Ran all test suites matching src/lib/causl/transport.test.ts|src/lib/causl/host-auth.test.ts|src/sections/sidebar/ChatSearchCommandMenu.test.tsx in 2 projects.

Command (cwd /home/ubuntu/subconscious-ai/onyx/.worktrees/twenty-panel-9/web), exit 0:

node node_modules/typescript-7/bin/tsc --noEmit --project tsconfig.types.json

Python verification uses an isolated environment with lockfile-pinned litellm 1.100.4 and ty 0.0.63. The shared runtime environment was not changed. Staff acceptance and deployment remain unproved. Issue #9 stays open. File exports and saved-memory writes remain unavailable for Twenty record turns. Search and attachment reading remain available.

@aviyashchin
aviyashchin merged commit 510733c into main Nov 2, 2026
41 of 67 checks passed
@aviyashchin
aviyashchin deleted the agent/codex-twenty-panel-9 branch November 2, 2026 13:07
@aviyashchin

Copy link
Copy Markdown
Author

Merged as 510733c. The merged Git tree equals the tested candidate tree. Local main is clean and current. No deployment or staff acceptance pass is claimed.

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.

1 participant