Skip to content

Revert "[NA] [BE] [SDK] Opik Connect"#6103

Merged
Nimrod007 merged 1 commit intomainfrom
revert-6074-collinc/bridge
Apr 7, 2026
Merged

Revert "[NA] [BE] [SDK] Opik Connect"#6103
Nimrod007 merged 1 commit intomainfrom
revert-6074-collinc/bridge

Conversation

@Nimrod007
Copy link
Copy Markdown
Collaborator

Reverts #6074

@Nimrod007 Nimrod007 requested review from a team as code owners April 7, 2026 12:13
@github-actions github-actions bot added documentation Improvements or additions to documentation dependencies Pull requests that update a dependency file python Pull requests that update Python code java Pull requests that update Java code Backend tests Including test files, or tests related like configuration. typescript *.ts *.tsx Python SDK TypeScript SDK labels Apr 7, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

📋 PR Linter Failed

Invalid Title Format. Your PR title must include a ticket/issue number and may optionally include component tags ([FE], [BE], etc.).

  • Internal contributors: Open a JIRA ticket and link to it: [OPIK-xxxx] or [CUST-xxxx] or [DND-xxxx] or [DEV-xxxx] [COMPONENT] Your change
  • External contributors: Open a Github Issue and link to it via its number: [issue-xxxx] [COMPONENT] Your change
  • No ticket: Use [NA] [COMPONENT] Your change (Issues section not required)

Example: [issue-3108] [BE] [FE] Fix authentication bug or [OPIK-1234] Fix bug or [NA] Update README


Missing Section. The description is missing the ## Details section.


Missing Section. The description is missing the ## Change checklist section.


Missing Section. The description is missing the ## Issues section.


Missing Section. The description is missing the ## Testing section.


Missing Section. The description is missing the ## Documentation section.

@Nimrod007 Nimrod007 merged commit 4f3571a into main Apr 7, 2026
145 of 147 checks passed
@Nimrod007 Nimrod007 deleted the revert-6074-collinc/bridge branch April 7, 2026 12:14
Comment on lines 736 to 739
if (shouldPurge) {
failOrphanedJobs(runnerId);
failOrphanedBridgeCommands(runnerId);
purgeRunner(runnerId, workspaceId, runnerMap.get(FIELD_USER_NAME));
}
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.

evictExistingRunner no longer calls failOrphanedJobs, leaving orphaned jobs running until the reaper; should we restore immediate failOrphanedJobs and bridge cleanup in the eviction path so old runner jobs fail as soon as a new connection takes over?

Finding type: Logical Bugs | Severity: 🔴 High


Want Baz to fix this for you? Activate Fixer

Other fix methods

Fix in Cursor

Prompt for AI Agents:

Before applying, verify this suggestion against the current code. In
apps/opik-backend/src/main/java/com/comet/opik/domain/LocalRunnerService.java around
lines 736 to 739 (method: reapRunner) you moved failOrphanedJobs out of the eviction
flow so evicted runners’ jobs are left running until purge time. Restore the original
immediate cleanup by modifying evictExistingRunner (the eviction logic around lines
~888-902) to: after deleting the old runner heartbeat, set FIELD_DISCONNECTED_AT on the
old runner map (if exists), call failOrphanedJobs(oldRunnerId) and also call
failOrphanedBridgeCommands(oldRunnerId) if bridge support remains, remove the old runner
from projectRunners and workspace/user runner sets (as the old code did), then log the
eviction. This will ensure orphaned jobs and bridge commands are failed immediately when
a newer connection evicts an older runner.

Comment on lines +15 to +19
@click.option("--pair", "pair_code", default=None, help="Pairing code for the runner.")
@click.option("--name", default=None, help="Runner name.")
@click.argument("command", nargs=-1, type=click.UNPROCESSED)
@click.pass_context
def connect(
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.

--pair wires to pair_code while the code uses pairing_code — should we rename the CLI to --pairing-code => pairing_code?

Finding type: Maintain naming consistency | Severity: 🟢 Low


Want Baz to fix this for you? Activate Fixer

Other fix methods

Fix in Cursor

Prompt for AI Agents:

Before applying, verify this suggestion against the current code. In
sdks/python/src/opik/cli/connect.py around lines 15 to 19, the CLI option is defined as
--pair with destination pair_code. Rename the CLI option to --pairing-code and the
destination/parameter from pair_code to pairing_code. Also update the connect function
signature where pair_code is declared (around lines 20-24) and all usages of pair_code
(notably the api.runners.connect_runner call around lines 49-56 and any other
references) to use pairing_code so the CLI, function parameter, and API call all use the
same identifier pairing_code.

Comment on lines 49 to +54
try:
runner_id, project_name = _register_runner(api, name, pair_code)
runner_name = name or f"{platform.node()}-{uuid.uuid4().hex[:6]}"
resp = api.runners.connect_runner(
runner_name=runner_name,
pairing_code=pair_code,
)
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.

pair_code is optional but we still call api.runners.connect_runner(... pairing_code=pair_code) unconditionally, should we make --pair required or check pair_code before calling connect_runner and surface a clearer CLI error?

Finding type: Type Inconsistency | Severity: 🔴 High


Want Baz to fix this for you? Activate Fixer

Other fix methods

Fix in Cursor

Prompt for AI Agents:

Before applying, verify this suggestion against the current code. In
sdks/python/src/opik/cli/connect.py around lines 49-54, the connect function calls
api.runners.connect_runner(pairing_code=pair_code) even though pair_code is Optional.
Before calling connect_runner, add a guard that checks if pair_code is present/truthy;
if it's missing, print a clear CLI error (e.g. "Error: Missing pairing code. Provide
--pair <code>.") to stderr and raise SystemExit(2). Then only call
api.runners.connect_runner when pair_code is provided. This keeps --pair optional at the
CLI level but fails fast with a user-friendly message instead of sending null to the
backend.

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

Labels

Backend dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation java Pull requests that update Java code Python SDK python Pull requests that update Python code tests Including test files, or tests related like configuration. TypeScript SDK typescript *.ts *.tsx

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant