Skip to content

fix(container): activate podman socket on Linux when not running#1610

Draft
bmahabirbu wants to merge 1 commit into
openkaiden:mainfrom
bmahabirbu:fix/podman-linux-socket-activation
Draft

fix(container): activate podman socket on Linux when not running#1610
bmahabirbu wants to merge 1 commit into
openkaiden:mainfrom
bmahabirbu:fix/podman-linux-socket-activation

Conversation

@bmahabirbu

Copy link
Copy Markdown
Contributor

Summary

  • On Linux, the podman API socket is not always active — it requires systemd socket activation or Podman Desktop to be running
  • Modified PodmanSocketLinuxFinder to spawn podman system service --time=0 when the rootless socket is missing, matching Podman Desktop's behavior
  • The spawned process is killed on extension deactivation via @preDestroy() dispose
  • Includes Flatpak support (flatpak-spawn --host)

Test plan

  • Unit tests updated and passing (11 tests)
  • On Linux without Podman Desktop running, verify Kaiden discovers podman containers
  • Verify socket process is cleaned up when Kaiden exits
  • Verify no duplicate process spawned on repeated socket finder polls

🤖 Generated with Claude Code

On Linux, the podman API socket is not always active — it requires
systemd socket activation or an explicit service start. This matches
Podman Desktop's behavior by spawning `podman system service --time=0`
when the socket is missing, waiting up to 5s for it to appear, and
killing the process on extension deactivation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Brian <bmahabir@bu.edu>
@bmahabirbu bmahabirbu requested a review from a team as a code owner May 5, 2026 04:22
@bmahabirbu bmahabirbu requested review from MarsKubeX and fbricon and removed request for a team May 5, 2026 04:22
@coderabbitai

coderabbitai Bot commented May 5, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@bmahabirbu has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 59 minutes and 49 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: cac449a2-4c75-48f9-8654-5946da5a4c8e

📥 Commits

Reviewing files that changed from the base of the PR and between fa9df61 and f588b9f.

📒 Files selected for processing (2)
  • extensions/container/packages/extension/src/helper/socket-finder/podman/podman-linux-finder.spec.ts
  • extensions/container/packages/extension/src/helper/socket-finder/podman/podman-linux-finder.ts

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.

@bmahabirbu

Copy link
Copy Markdown
Contributor Author

This was needed because on linux it couldnt find the ramalama services because of this

@bmahabirbu

Copy link
Copy Markdown
Contributor Author

relates to #1602

@codecov

codecov Bot commented May 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.30769% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...helper/socket-finder/podman/podman-linux-finder.ts 92.30% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@jeffmaury jeffmaury 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.

I'm questioning the rationale as we don't have this in Podman Desktop as ask user to run it so might have permissions issues. @benoitf might help

let args = ['system', 'service', '--time=0'];
if (process.env.FLATPAK_ID) {
command = 'flatpak-spawn';
args = ['--host', 'podman', ...args];

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.

praise: should use exec from the extension API

@bmahabirbu

Copy link
Copy Markdown
Contributor Author

@jeffmaury I noticed that in podman-desktop the socket opens and closes automatically on linux so thought id just try to add the functionality in kaiden too

@bmahabirbu bmahabirbu requested a review from benoitf May 5, 2026 06:15
@benoitf

benoitf commented May 5, 2026

Copy link
Copy Markdown
Contributor

so I know in Podman Desktop we start the service but users are complaining that sometimes they have the service already started so there are like 2 servers then

@benoitf benoitf 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.

overall I'm ok as it simplifies the default experience but as @jeffmaury said, it needs to use the exec API

@MarsKubeX MarsKubeX 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.

Looks good in general but same comment as the others, use exec from the api extension

@benoitf

benoitf commented May 6, 2026

Copy link
Copy Markdown
Contributor

@bmahabirbu are you planning to fix this ? or we put the label 'on hold'

@benoitf benoitf marked this pull request as draft May 7, 2026 19:41
@benoitf

benoitf commented May 7, 2026

Copy link
Copy Markdown
Contributor

setting to draft as I didn't get a reply

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.

4 participants