Skip to content

Add TCP support for Python Executor and local debugging guide#1875

Open
sehan-dissanayake wants to merge 6 commits intowso2:mainfrom
sehan-dissanayake:python-tcp-support
Open

Add TCP support for Python Executor and local debugging guide#1875
sehan-dissanayake wants to merge 6 commits intowso2:mainfrom
sehan-dissanayake:python-tcp-support

Conversation

@sehan-dissanayake
Copy link
Copy Markdown
Contributor

@sehan-dissanayake sehan-dissanayake commented May 5, 2026

Fix:

Purpose

Previously, communication between the Go Policy Engine and the Python Executor was hardcoded to use Unix Domain Sockets (UDS). This architectural constraint prevented the Python Executor from running in a separate container (e.g., for future GPU-isolated workloads) and made local development and debugging of Python policies extremely difficult, as developers could not easily attach IDE debuggers (like VS Code) or use tools like pdb without complex container modifications.

Goals

  • Introduce dual-mode (UDS and TCP) gRPC transport support for both the Go Policy Engine (client) and the Python Executor (server).
  • Enable 12-factor app compliance for the Python Executor by removing unnecessary config file reading and relying strictly on environment variables and CLI flags.
  • Establish a clear, documented workflow for developers to run the Python Executor locally on their host machine for rapid iteration and debugging.

Approach

  1. Python Executor TCP Support: Updated main.py and server.py to accept a flexible --listen argument that automatically detects and binds to either a UDS path or a TCP address (e.g., localhost:9010).
  2. **Configuration:**Can configure exclusively via CLI flags (--listen, --workers, --timeout, etc.) and environment variables.
  3. Go Client TCP Support: Refactored client.go to dial dynamically based on the configuration provided in config.toml ([python_executor.server]).
  4. Registry Versioning Sync: Ensured generator.go and the Python registry continue to use major-version keys (e.g., prompt-compressor:v0) to maintain consistency with the Go Policy Engine's internal registry conventions.
  5. Documentation: Added a comprehensive PYTHON_DEBUG_GUIDE.md detailing the "Option 2" style local process debugging setup.

Documentation

Created gateway/PYTHON_DEBUG_GUIDE.md to document the new local debugging workflow.

Security checks

Test environment

  • macOS (Host)
  • Docker / Rancher Desktop (Lima)
  • Go 1.22+
  • Python 3.10+

Introduce a configurable Python executor (UDS or TCP) and wire it into the policy engine.

Key changes:
- Add [python_executor] section to config-template.toml (server mode/host/port and timeout).
- Add PythonExecutorConfig types, defaults and validation in policy engine config.
- Initialize pythonbridge from configuration in policy-engine main and use pythonbridge.IsAvailable when starting admin server.
- Refactor pythonbridge StreamManager to use address + isTCP, add Init(cfg) to configure the global manager, support TCP vs UDS dialing, expose IsAvailable, and centralize timeout handling. Update tests accordingly.
- Update Python executor server to accept a listen address (supports TCP or UDS), cleanup stale UDS files, and improve logging.
- Update Python executor main to read TOML config (tomli/tomllib), add --listen flag and config-aware defaults; add tomli to requirements for Python <3.11.
- Prevent overriding the executor listen address in docker-entrypoint; adjust docker-compose (comment out admin/metrics port mappings and set GATEWAY_CONTROLLER_HOST=host.docker.internal).
- Skip common Python virtualenv/cache/.git directories when copying policy sources in the builder.

These changes allow running the Python executor over TCP (useful for containerized setups) or UDS, provide configurable timeouts, improve startup robustness, and keep tests and tooling aligned.
Add a comprehensive PYTHON_DEBUG_GUIDE.md for running and debugging the Python Executor locally (TCP mode, VS Code/pdb tips, steps to build, run, and cleanup). Change pythonbridge factory to resolve the global StreamManager at GetPolicy time instead of carrying it on BridgeFactory: remove the StreamManager field, call GetStreamManager() in GetPolicy, and pass that instance to InitPolicy and the created bridge. Update the plugin registry template to stop injecting StreamManager into the generated BridgeFactory. This ensures the singleton StreamManager is configured after pythonbridge.Init(cfg) in main before use.
Add a new VS Code debug configuration for the Python Executor (debugpy) in .vscode/launch.json to launch the executor module with appropriate args and PYTHONPATH. Overhaul gateway/PYTHON_DEBUG_GUIDE.md: clarify the host-process debugging workflow, update the mermaid diagram, add warnings about Go module resolution and Rancher Desktop, instruct using host.docker.internal (or host IP) and specific docker-compose changes (set GATEWAY_CONTROLLER_HOST and comment Policy Engine ports), renumber and clarify steps, provide updated Docker Compose commands (run from gateway/), add cleanup guidance, and update the ports table and assorted wording tweaks.
Remove TOML config parsing and dependency; rely on environment variables for defaults instead. main.py no longer reads a --config TOML file at startup and uses PYTHON_EXECUTOR_LISTEN and PYTHON_POLICY_TIMEOUT (env) as defaults; help text updated to clarify listen can be a UDS path or host:port. requirements.txt drops tomli. VS Code launch.json entries no longer pass --config. PYTHON_DEBUG_GUIDE.md updated with Rancher Desktop (Lima) instructions to export HOST_IP and apply it to the relevant steps, plus adjusted docs to reflect that the executor binds to localhost:9010 when using TCP. These changes simplify startup and remove the toml parsing requirement.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 2026

📝 Walkthrough

Summary

Adds dual-mode gRPC transport (Unix Domain Sockets and TCP) between the Go Policy Engine and the Python Executor, enabling the Python Executor to run as a standalone host process and improving local debugging and developer workflows.

Core Changes

  • Python Executor

    • main.py: adds --listen flag and DEFAULT_LISTEN_ADDRESS; listens on UDS or TCP (auto-detected from the listen value); configuration via CLI flags and environment variables; improved startup logs.
    • server.py: accepts a listen_address, detects TCP vs UDS, cleans up stale UDS files safely, validates bind success, and supports configurable worker count, concurrency, and timeouts.
    • Renamed/standardized constants and removed config-file-only reliance in favor of env/CLI.
  • Go Policy Engine

    • Introduces PythonExecutorConfig and PythonExecutorServerConfig types; registers PythonExecutor field in main config and provides defaults (mode: uds, host: localhost, port: 9010, timeout: 30s).
    • Adds validation for server mode, TCP host/port ranges, and timeout.
    • pythonbridge: refactors StreamManager to support address + isTCP, adds DefaultSocketPath constant, Init(cfg) and IsAvailable(cfg) functions, centralizes timeout handling, and defers StreamManager initialization until needed.
    • BridgeFactory no longer carries a StreamManager; it resolves the global singleton at GetPolicy time.
    • Policy engine wiring: pythonbridge.Init called during startup and availability checks updated.
  • Configuration & Entrypoints

    • Adds [python_executor] config block in config-template.toml.
    • docker-entrypoint.sh enforces the configured listen address and prevents overriding via CLI.

Documentation & Developer Experience

  • Adds gateway/PYTHON_DEBUG_GUIDE.md with a step-by-step local debugging workflow (host vs Docker topology, build steps, Docker Compose adjustments, run commands, VS Code debugpy configuration, troubleshooting, and cleanup).
  • Adds a VS Code debug configuration (.vscode/launch.json) to launch the Python Executor with debugpy on localhost:9010.

Miscellaneous

  • generator.go: copyDir now skips virtualenv/cache directories when copying registry artifacts.
  • Minor test updates to accommodate StreamManager signature changes and initialization behavior.
  • Commit updates include a small import fix (strconv) and documentation cleanups.

Impact

Enables running and debugging the Python Executor outside containers using TCP while preserving UDS behavior by default for production. Improves configuration flexibility, startup robustness, and developer tooling for local policy development.

Walkthrough

This PR adds configurable Python Executor connectivity (UDS or TCP) and runtime/debugging support. It introduces PythonExecutor configuration types and validation, initializes the pythonbridge from configuration, and changes StreamManager to support address+isTCP with Init/IsAvailable/GetStreamManager APIs. The Python Executor and its CLI now accept a listen address (UDS path or host:port). The build generator ignores common venv/cache dirs and the policy factory template no longer embeds a StreamManager. A host-debugging guide and VS Code debug configuration were added; the Docker entrypoint blocks overriding the executor listen address.

Sequence Diagram

sequenceDiagram
    participant Cfg as Config
    participant PE as Policy Engine
    participant Bridge as pythonbridge
    participant SM as StreamManager
    participant Executor as Python Executor

    Cfg->>PE: Load full config (python_executor.server, timeout)
    PE->>Bridge: Init(cfg.PythonExecutor)
    activate Bridge
    Bridge->>Bridge: determine configuredAddress & configuredIsTCP
    Bridge->>SM: NewStreamManager(configuredAddress, configuredIsTCP)
    deactivate Bridge

    PE->>Bridge: IsAvailable(cfg.PythonExecutor)
    alt mode == "tcp"
        Bridge-->>PE: true
    else mode == "uds"
        Bridge->>Bridge: stat socket path
        Bridge-->>PE: true/false
    end

    PE->>SM: GetStreamManager()
    activate SM
    SM->>Executor: Connect()
    alt isTCP == true
        SM->>Executor: Dial TCP (host:port)
    else
        SM->>Executor: Dial Unix socket (path)
    end
    Executor-->>SM: gRPC connection established
    deactivate SM

    PE->>SM: InitPolicy(ctx, req)
    SM->>Executor: ExecuteStream RPC
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add TCP support for Python Executor and local debugging guide' clearly and concisely summarizes the primary changes: TCP support for the Python Executor and documentation for local debugging.
Description check ✅ Passed The description covers Purpose, Goals, Approach, Documentation, and Security checks. While some template sections are omitted (User stories, Samples, Related PRs), the essential context is provided and the description is substantive and complete.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.12.1)

level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain modules listed in go.work or their selected dependencies"


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 and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
gateway/gateway-runtime/docker-entrypoint.sh (1)

126-127: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Export PYTHON_EXECUTOR_SOCKET and pass it explicitly to the Python Executor to prevent configuration drift and environment variable bypasses.

PYTHON_EXECUTOR_SOCKET is set as a local shell variable (Line 126) but never exported. The Python Executor is launched at Line 188 without an explicit --listen argument, relying instead on a hard-coded default path and the PYTHON_EXECUTOR_LISTEN environment variable fallback. While the defaults currently match, this creates fragility: if the socket path configuration ever diverges, the socket-wait loop (Lines 197–208) will timeout silently.

More critically, the CLI guard at Lines 8–10 blocks --py.listen flag overrides, but an operator can bypass this by setting the PYTHON_EXECUTOR_LISTEN environment variable, causing the Python Executor to listen on an unintended path and making the socket-wait loop hang indefinitely.

Proposed fix
-PYTHON_EXECUTOR_SOCKET="/var/run/api-platform/python-executor.sock"
+export PYTHON_EXECUTOR_SOCKET="/var/run/api-platform/python-executor.sock"
 python3 /app/python-executor/main.py "${PY_ARGS[@]}" \
+    --listen "${PYTHON_EXECUTOR_SOCKET}" \
🤖 Prompt for 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.

In `@gateway/gateway-runtime/docker-entrypoint.sh` around lines 126 - 127,
PYTHON_EXECUTOR_SOCKET is defined but not exported and the Python Executor is
started without an explicit --listen, allowing env var bypass; export the
PYTHON_EXECUTOR_SOCKET variable (so it becomes part of the environment), ensure
the Python Executor startup command uses that variable explicitly as the
--listen argument (use PYTHON_EXECUTOR_SOCKET rather than relying on defaults or
PYTHON_EXECUTOR_LISTEN), and update the socket-wait loop to check the same
exported PYTHON_EXECUTOR_SOCKET value; optionally clear or ignore
PYTHON_EXECUTOR_LISTEN before launch to prevent operators from overriding the
intended socket path.
🧹 Nitpick comments (1)
gateway/gateway-runtime/policy-engine/internal/config/config_test.go (1)

65-71: ⚡ Quick win

Missing test cases for the new python_executor validation rules.

config.go introduces python_executor.server.mode, python_executor.server.port, and python_executor.timeout validation, but no test cases exercise these paths. Consider adding a TestValidate_PythonExecutorConfig table test covering at minimum:

  • mode = "tcp" with valid port
  • mode = "tcp" with out-of-range port (0, 65536)
  • mode = "invalid" (unknown string)
  • timeout = 0 / negative (should error)

This follows the same pattern as the existing TestValidate_ServerMode and TestValidate_ExtProcPort tests.

🤖 Prompt for 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.

In `@gateway/gateway-runtime/policy-engine/internal/config/config_test.go` around
lines 65 - 71, Add a new table-driven test TestValidate_PythonExecutorConfig in
config_test.go that exercises the validation rules for
PythonExecutorConfig/PythonExecutorServerConfig: create cases for
server.mode="tcp" with a valid port, server.mode="tcp" with out-of-range ports
(0 and 65536) expecting errors, server.mode="invalid" expecting an unknown-mode
error, and timeout values of 0 and a negative duration expecting validation
errors; for each case construct a config with PythonExecutor:
PythonExecutorConfig{Server: PythonExecutorServerConfig{Mode: "<case>", Port:
<port>}, Timeout: <timeout>} and call the existing Validate() (or the package's
validation entrypoint used by other tests like
TestValidate_ServerMode/TestValidate_ExtProcPort) asserting error vs no-error
per case and matching error messages where applicable.
🤖 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 `@gateway/gateway-runtime/policy-engine/internal/config/config.go`:
- Around line 399-407: The validation for c.PythonExecutor.Server currently only
checks Mode and Port but does not ensure Server.Host is non-empty for tcp mode;
update the switch branch for case "tcp" in the validation function to
additionally check that c.PythonExecutor.Server.Host is not an empty string and
return a descriptive error (e.g., "invalid python_executor.server.host: must be
non-empty when mode = 'tcp'") if it is; reference the
c.PythonExecutor.Server.Mode, c.PythonExecutor.Server.Host and
c.PythonExecutor.Server.Port fields and mirror the same non-empty host check
used by the PolicyEngine.Server validation block for consistency.

In `@gateway/gateway-runtime/policy-engine/internal/pythonbridge/client.go`:
- Around line 485-513: Init, GetStreamManager and IsAvailable currently always
use DefaultSocketPath for UDS so non-default UDS listen addresses are ignored;
update the code to read the UDS path from the PythonExecutorConfig (e.g.,
cfg.Server.Listen or add a new cfg.Server.Path) when mode != "tcp" and pass that
value into NewStreamManager (and into any calls inside
GetStreamManager/IsAvailable) instead of DefaultSocketPath; ensure the
streamManagerOnce initialization and any checks reference the configured address
variable so a Python executor started with a custom UDS path is reachable.

In `@gateway/PYTHON_DEBUG_GUIDE.md`:
- Around line 147-163: The controller launch snippet omits
APIP_GW_ROUTER_POLICY__ENGINE_HOST so the router (running in Docker) cannot
reach the host Policy Engine; update the example environment block to include
APIP_GW_ROUTER_POLICY__ENGINE_HOST (e.g., host.docker.internal or the host IP)
alongside APIP_GW_ROUTER_POLICY__ENGINE_MODE=tcp so the router can connect to
the host Policy Engine when using TCP.
- Around line 257-260: Replace the hardcoded credentials in the curl example
(the `-u admin:admin` portion of the shown curl command) with a placeholder or
environment-variable expansion so secrets aren't committed; for example change
it to use env vars like `-u "$ADMIN_USER:$ADMIN_PASS"` or a generic placeholder
such as `-u "<USERNAME>:<PASSWORD>"` and update the surrounding text/examples to
document setting those env vars.

---

Outside diff comments:
In `@gateway/gateway-runtime/docker-entrypoint.sh`:
- Around line 126-127: PYTHON_EXECUTOR_SOCKET is defined but not exported and
the Python Executor is started without an explicit --listen, allowing env var
bypass; export the PYTHON_EXECUTOR_SOCKET variable (so it becomes part of the
environment), ensure the Python Executor startup command uses that variable
explicitly as the --listen argument (use PYTHON_EXECUTOR_SOCKET rather than
relying on defaults or PYTHON_EXECUTOR_LISTEN), and update the socket-wait loop
to check the same exported PYTHON_EXECUTOR_SOCKET value; optionally clear or
ignore PYTHON_EXECUTOR_LISTEN before launch to prevent operators from overriding
the intended socket path.

---

Nitpick comments:
In `@gateway/gateway-runtime/policy-engine/internal/config/config_test.go`:
- Around line 65-71: Add a new table-driven test
TestValidate_PythonExecutorConfig in config_test.go that exercises the
validation rules for PythonExecutorConfig/PythonExecutorServerConfig: create
cases for server.mode="tcp" with a valid port, server.mode="tcp" with
out-of-range ports (0 and 65536) expecting errors, server.mode="invalid"
expecting an unknown-mode error, and timeout values of 0 and a negative duration
expecting validation errors; for each case construct a config with
PythonExecutor: PythonExecutorConfig{Server: PythonExecutorServerConfig{Mode:
"<case>", Port: <port>}, Timeout: <timeout>} and call the existing Validate()
(or the package's validation entrypoint used by other tests like
TestValidate_ServerMode/TestValidate_ExtProcPort) asserting error vs no-error
per case and matching error messages where applicable.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 97500baf-241f-4e12-a913-fad44f91cf50

📥 Commits

Reviewing files that changed from the base of the PR and between 3574c93 and ccae833.

📒 Files selected for processing (15)
  • .vscode/launch.json
  • gateway/PYTHON_DEBUG_GUIDE.md
  • gateway/configs/config-template.toml
  • gateway/gateway-builder/internal/policyengine/generator.go
  • gateway/gateway-builder/templates/plugin_registry.go.tmpl
  • gateway/gateway-runtime/docker-entrypoint.sh
  • gateway/gateway-runtime/policy-engine/cmd/policy-engine/main.go
  • gateway/gateway-runtime/policy-engine/internal/config/config.go
  • gateway/gateway-runtime/policy-engine/internal/config/config_test.go
  • gateway/gateway-runtime/policy-engine/internal/pythonbridge/bridge_test.go
  • gateway/gateway-runtime/policy-engine/internal/pythonbridge/client.go
  • gateway/gateway-runtime/policy-engine/internal/pythonbridge/client_test.go
  • gateway/gateway-runtime/policy-engine/internal/pythonbridge/factory.go
  • gateway/gateway-runtime/python-executor/executor/server.py
  • gateway/gateway-runtime/python-executor/main.py
💤 Files with no reviewable changes (1)
  • gateway/gateway-builder/templates/plugin_registry.go.tmpl

Comment thread gateway/gateway-runtime/policy-engine/internal/config/config.go
Comment thread gateway/PYTHON_DEBUG_GUIDE.md
Comment thread gateway/PYTHON_DEBUG_GUIDE.md
Add support for configuring the Python executor Unix socket path and TCP mode, and wire that through runtime, config validation, tests, docs and the Docker entrypoint.

- config: add PythonExecutorServer.Path, validate host when mode=tcp and ensure timeout > 0
- pythonbridge: use a configured socket/path and TCP flag for StreamManager and availability checks (fall back to default path when unset)
- entrypoint: export PYTHON_EXECUTOR_SOCKET and start the python executor with --listen using the socket; unset PYTHON_EXECUTOR_LISTEN before launching
- tests: add TestValidate_PythonExecutorConfig covering UDS/tcp, host/port validation and timeouts
- docs: update PYTHON_DEBUG_GUIDE to clarify controller env var usage and authentication placeholder for API deploy

These changes allow switching between UDS and TCP modes and customizing the UDS path reliably across components.
@sehan-dissanayake
Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 2026

✅ Actions performed

Full review triggered.

@sehan-dissanayake
Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 2026

✅ Actions performed

Full review triggered.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 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 `@gateway/gateway-runtime/policy-engine/internal/pythonbridge/client.go`:
- Around line 500-505: The TCP address construction in the mode=="tcp" branch
(building the variable address) incorrectly uses fmt.Sprintf("%s:%d", host,
cfg.Server.Port) which breaks IPv6 literals; change it to use
net.JoinHostPort(host, strconv.Itoa(cfg.Server.Port)) to correctly format IPv4,
IPv6 and hostnames, and add imports for net and strconv if not already present;
keep the existing host defaulting logic (host == "" -> "localhost") and assign
the result back to address.

In `@gateway/PYTHON_DEBUG_GUIDE.md`:
- Around line 67-75: The guide incorrectly instructs the reader to run a second
"cd gateway" in Step 8 which will end up in gateway/gateway; update Step 8 to
either remove the redundant "cd gateway" or add a clear sentence telling the
reader to return to the repository root before running the commands so the
subsequent relative paths (e.g., "go run ./gateway-builder/cmd/builder ..." and
the later compose commands at lines 248-250) resolve correctly; apply the same
clarification or removal for the repeated "cd gateway" instances at 248-250.
- Around line 181-187: Update the two fenced code blocks that show Python
Executor logs (the blocks starting with "Python Executor starting
(listen=localhost:9010, workers=4, ...)" and the other block around "Python
Executor ready on localhost:9010") to include a language tag (e.g., change ```
to ```text or ```log) so markdownlint no longer flags them; make the same change
for the other occurrence noted (the snippet around the "Python Executor ready"
lines).
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 7a3109e5-7441-4d9f-976e-c6612c551cfa

📥 Commits

Reviewing files that changed from the base of the PR and between 3574c93 and 1bca046.

📒 Files selected for processing (15)
  • .vscode/launch.json
  • gateway/PYTHON_DEBUG_GUIDE.md
  • gateway/configs/config-template.toml
  • gateway/gateway-builder/internal/policyengine/generator.go
  • gateway/gateway-builder/templates/plugin_registry.go.tmpl
  • gateway/gateway-runtime/docker-entrypoint.sh
  • gateway/gateway-runtime/policy-engine/cmd/policy-engine/main.go
  • gateway/gateway-runtime/policy-engine/internal/config/config.go
  • gateway/gateway-runtime/policy-engine/internal/config/config_test.go
  • gateway/gateway-runtime/policy-engine/internal/pythonbridge/bridge_test.go
  • gateway/gateway-runtime/policy-engine/internal/pythonbridge/client.go
  • gateway/gateway-runtime/policy-engine/internal/pythonbridge/client_test.go
  • gateway/gateway-runtime/policy-engine/internal/pythonbridge/factory.go
  • gateway/gateway-runtime/python-executor/executor/server.py
  • gateway/gateway-runtime/python-executor/main.py
💤 Files with no reviewable changes (1)
  • gateway/gateway-builder/templates/plugin_registry.go.tmpl

Comment thread gateway/gateway-runtime/policy-engine/internal/pythonbridge/client.go Outdated
Comment thread gateway/PYTHON_DEBUG_GUIDE.md Outdated
Comment thread gateway/PYTHON_DEBUG_GUIDE.md Outdated
Use net.JoinHostPort with strconv.Itoa for building the host:port address in the pythonbridge client (adds strconv import). Update PYTHON_DEBUG_GUIDE.md by changing fenced blocks to text and removing redundant `cd gateway` lines and minor whitespace cleanup to improve clarity.
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

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 `@gateway/PYTHON_DEBUG_GUIDE.md`:
- Around line 29-33: Remove the blank line between the adjacent admonition
blocks so the two blockquotes "[!NOTE]" and "[!WARNING]" are consecutive; edit
the markdown in PYTHON_DEBUG_GUIDE.md to delete the empty line separating the
NOTE block and the WARNING block (the lines starting with "[!NOTE]" and
"[!WARNING]") so MD028 is satisfied.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f5d7a9cc-5413-494d-9edc-89324b709c10

📥 Commits

Reviewing files that changed from the base of the PR and between 1bca046 and b5d0aa4.

📒 Files selected for processing (2)
  • gateway/PYTHON_DEBUG_GUIDE.md
  • gateway/gateway-runtime/policy-engine/internal/pythonbridge/client.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • gateway/gateway-runtime/policy-engine/internal/pythonbridge/client.go

Comment thread gateway/PYTHON_DEBUG_GUIDE.md
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