Skip to content

fix(endpoints): unique stable per-pipe endpoint URLs ({host}/{type}/{project_id}/{source})#1557

Open
kgarg2468 wants to merge 3 commits into
developfrom
fix/262-unique-endpoint-urls
Open

fix(endpoints): unique stable per-pipe endpoint URLs ({host}/{type}/{project_id}/{source})#1557
kgarg2468 wants to merge 3 commits into
developfrom
fix/262-unique-endpoint-urls

Conversation

@kgarg2468

@kgarg2468 kgarg2468 commented Jul 12, 2026

Copy link
Copy Markdown
Collaborator

Two pipes with same-typed source nodes advertise the same endpoint URL

Endpoint URLs are derived only from the source node type ({host}/chat, {host}/dropper, {host}/webhook in webhook/IEndpoint.py), so any two pipes with same-typed sources show identical URLs — users can't tell endpoints apart and rely on the opaque ?auth= token for disambiguation (reported in rocketride-ai/rocketride-saas#262).

Fix — additive, no breaking changes:

  • Advertised URLs now embed the canonical task identity: {host}/{type}/{project_id}/{source} (e.g. /chat/<project-uuid>/chat_1). project_id + source is exactly the engine's task identity and the same input that already deterministically derives the pk_/tk_ tokens — stable across restarts, no secret in the path.
  • task_engine substitutes the new {project_id}/{source} placeholders alongside the existing {public_auth}.
  • New POST routes /webhook/{project_id}/{source} and /task/data/{project_id}/{source}task_Data, which resolves the task from the path when no explicit token param is supplied. Existing auth precedence unchanged.
  • Legacy routes and ?auth= resolution untouched — every currently-deployed URL keeps working.
  • No SPA or UI changes needed (verified: chat/dropper static routes already index-fallback on deep paths, assetPrefix is absolute, and the SPAs identify their task from ?auth=, not the path). Docs updated (webhook-pipeline example + webhook README).

Testing

  • Tested locally — E2E on a patched engine: two pipes with identically-named webhook sources → distinct URLs (/webhook/proj-a-262/webhook_1 vs /webhook/proj-b-262/webhook_1); POST to each pretty path → 200 into the correct pipe; POST to legacy /webhook with Bearer token → 200; relaunch → byte-identical URLs and tokens (deterministic identity confirmed).
  • Tests added or updated — n/a (behavior covered by the E2E script; no existing suite for this surface)
  • Commit messages follow conventional commits
  • No secrets or credentials included

Linked Issue

Fixes rocketride-ai/rocketride-saas#262

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added project- and source-aware URL patterns for Chat, Dropper, Webhook, and task data endpoints, including POST /task/data/{project_id}/{source} and /webhook/{project_id}/{source} aliasing.
    • Task note templating now supports {project_id} and {source} placeholders.
  • Bug Fixes
    • Improved project-specific task data handling by auto-resolving missing tokens from the request context when possible.
    • Preserved compatibility with legacy endpoint URL paths.
  • Documentation
    • Updated webhook and pipeline examples to use project-aware URLs and clarified ?auth= behavior.

Advertised chat/dropper/webhook URLs now embed the task identity as
{host}/{type}/{project_id}/{source}; additive path routes accept data
POSTs and resolve the task from the path. Legacy routes and ?auth=
resolution unchanged.

Fixes rocketride-ai/rocketride-saas#262

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor
🤖 Internal: Discord sync marker

Auto-managed by the Discord notification workflow. Stores the linked Discord message ID and forum thread ID. Do not edit or delete.

@github-actions github-actions Bot added docs Documentation module:nodes Python pipeline nodes module:ai AI/ML modules labels Jul 12, 2026
@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 93f9a47f-62ba-4069-b8bd-7428d774ab29

📥 Commits

Reviewing files that changed from the base of the PR and between 7663b84 and f0d042f.

📒 Files selected for processing (1)
  • packages/ai/src/ai/modules/task/task_engine.py

📝 Walkthrough

Walkthrough

Project and source identifiers are propagated through webhook, chat, dropper, and task-data URLs. Task data can resolve tokens from path parameters, task notes support project/source substitution, and documentation reflects the new and legacy routes.

Changes

Project-scoped webhook flow

Layer / File(s) Summary
Project-scoped endpoint URLs and routes
nodes/src/nodes/webhook/IEndpoint.py, packages/ai/src/ai/modules/task_http/__init__.py
Generated chat, dropper, and webhook links include project_id and source; parameterized webhook and task-data routes are registered alongside existing routes.
Task token resolution and note templating
packages/ai/src/ai/modules/task_http/task_data.py, packages/ai/src/ai/modules/task/task_engine.py
Task-data requests can resolve tokens from project/source path parameters, and task notes substitute those values in strings and dictionary values.
Webhook documentation and examples
nodes/src/nodes/webhook/README.md, packages/docs/content-static/examples/webhook-pipeline.md
Documentation and examples use project/source-specific URLs, describe auth query usage, and retain legacy route compatibility details.

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

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant WebhookRoute
  participant task_Data
  participant TaskControl
  participant Task
  Client->>WebhookRoute: POST /webhook/{project_id}/{source}
  WebhookRoute->>task_Data: forward request with path parameters
  task_Data->>TaskControl: resolve control by project and source
  TaskControl-->>task_Data: return task token
  task_Data->>Task: process task data and update notes
Loading

Suggested reviewers: jmaionchi, rod-christensen, stepmikhaylov

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: stable per-pipe endpoint URLs using project_id and source placeholders.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/262-unique-endpoint-urls

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.

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/ai/src/ai/modules/task_http/task_data.py`:
- Around line 476-480: Update the exception handling around
get_task_control_by_project in the task request flow so it no longer swallows
RuntimeError or unrelated failures. Catch the specific expected missing-task
RuntimeError and preserve the token=None fallback, or propagate it as the
appropriate client error; allow unexpected exceptions to propagate instead of
using a broad except Exception.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 9001db3e-426c-46a3-8995-3ae8e31eab92

📥 Commits

Reviewing files that changed from the base of the PR and between 37cd055 and 4fd8479.

📒 Files selected for processing (6)
  • nodes/src/nodes/webhook/IEndpoint.py
  • nodes/src/nodes/webhook/README.md
  • packages/ai/src/ai/modules/task/task_engine.py
  • packages/ai/src/ai/modules/task_http/__init__.py
  • packages/ai/src/ai/modules/task_http/task_data.py
  • packages/docs/content-static/examples/webhook-pipeline.md

Comment thread packages/ai/src/ai/modules/task_http/task_data.py
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@kgarg2468

Copy link
Copy Markdown
Collaborator Author

@coderabbitai Addressed in 7663b84 — the fallback now catches only RuntimeError (the documented missing-task case from get_task_control_by_project); anything unexpected propagates as a server error.

@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
cd rocketride-server 2>/dev/null || true
git fetch origin pull/1557/head:pr1557 2>/dev/null
git log --oneline -5 7663b847 2>/dev/null || true
git show 7663b847 -- packages/ai/src/ai/modules/task_http/task_data.py 2>/dev/null

Length of output: 1918


@kgarg2468 Confirmed — commit 7663b84 narrows the except Exception to except RuntimeError, so only the documented missing-task case from get_task_control_by_project falls back to token=None, while any unexpected exceptions now propagate as a server error. Thanks for addressing this!

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@kgarg2468

Copy link
Copy Markdown
Collaborator Author

CI build failures fixed in the latest push — the placeholder substitution now uses getattr so partially-initialized tasks (as constructed by test_task_engine.py stubs) don't raise AttributeError. Full test file passes locally (52/52).

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

Labels

docs Documentation module:ai AI/ML modules module:nodes Python pipeline nodes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant