mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-03 22:19:42 +02:00
feat(omp): install omp in the docker agent image, isolate its credentials
OMP had full routing at the Docker layer (default pane command, schema) but
was never actually installed in docker/agent.Dockerfile, and had no
credential-isolation entry in docker-hosts.ts's CRED_STORES - a Docker-mode
OMP session would have failed with "omp: command not found", and even with
the binary present would have had no config/auth seeded, despite the README
already claiming OMP has "seamless auth, isolated credentials" in Docker.
- docker/agent.Dockerfile: install omp via its own installer (standalone
binary, same shape as grok/antigravity - not on npm). Verified against a
real --no-cache build: the installer actually targets ~/.local/bin, not
~/.omp/bin as the resolver's OMP_SEARCH_DIRS ordering would suggest -
confirmed omp/18.0.8 installs and runs correctly inside the image.
- src/docker-hosts.ts: add a .omp/agent CRED_STORES entry. Unlike every
sibling CLI in this family, sessions/ is SHARED (RW), not seeded: Codeman
reads ~/.omp/agent/sessions/**/*.jsonl host-side for history recovery and
--resume pinning (omp-transcript.ts, omp-session-resolver.ts), the same
reason codex's sessions/ is shared rather than seeded. Seeding it instead
would silently break the kill-survival feature for Docker cases. Only the
small config files (config.yml/mcp.json/models.yml/settings.yml) are
seeded; the SQLite caches and terminal-sessions/ stay container-local.
- test/docker-hosts.test.ts: pin the new CRED_STORES entry's behavior.
Found in passing (NOT fixed here, unrelated and pre-existing on master): the
agent image's DeepSeek (dsh) plugin-install step currently fails on a fresh
build ("pnpm not found on PATH"), confirmed via git diff against
origin/master that this line is untouched by this branch. Worth a separate
issue/PR.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
853681f970
commit
d74cde759b
@@ -329,6 +329,32 @@ describe('resolveDockerCredentialArtifacts (isolated codex/gemini/gcloud/opencod
|
||||
expect(mounts).toEqual([]);
|
||||
expect(seedCopies).toEqual([]);
|
||||
});
|
||||
|
||||
it('omp: shares sessions/ RW (host-side history/resume reads), seeds config files only', () => {
|
||||
mkdirSync(join(home, '.omp', 'agent', 'sessions'), { recursive: true });
|
||||
writeFileSync(join(home, '.omp', 'agent', 'config.yml'), '');
|
||||
writeFileSync(join(home, '.omp', 'agent', 'mcp.json'), '{}');
|
||||
writeFileSync(join(home, '.omp', 'agent', 'models.yml'), '');
|
||||
writeFileSync(join(home, '.omp', 'agent', 'settings.yml'), '');
|
||||
// Regenerable local state that must NOT be seeded (mirrors the pi/grok exclusions).
|
||||
writeFileSync(join(home, '.omp', 'agent', 'agent.db'), '');
|
||||
mkdirSync(join(home, '.omp', 'agent', 'terminal-sessions'), { recursive: true });
|
||||
|
||||
const { mounts, seedCopies } = resolveDockerCredentialArtifacts(home);
|
||||
expect(mounts).toContainEqual({
|
||||
src: join(home, '.omp', 'agent', 'sessions'),
|
||||
dst: '/home/agent/.omp/agent/sessions',
|
||||
});
|
||||
const dests = seedCopies.map((s) => s.to);
|
||||
expect(dests).toContain('/home/agent/.omp/agent/config.yml');
|
||||
expect(dests).toContain('/home/agent/.omp/agent/mcp.json');
|
||||
expect(dests).toContain('/home/agent/.omp/agent/models.yml');
|
||||
expect(dests).toContain('/home/agent/.omp/agent/settings.yml');
|
||||
expect(dests).not.toContain('/home/agent/.omp/agent/agent.db');
|
||||
expect(mounts.some((m) => m.dst === '/home/agent/.omp/agent/terminal-sessions')).toBe(false);
|
||||
// seed copies of individual files are NOT recursive
|
||||
expect(seedCopies.filter((s) => s.to.startsWith('/home/agent/.omp')).every((s) => !s.recursive)).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe('resolveDockerClaudeArtifacts (isolated claude state)', () => {
|
||||
|
||||
Reference in New Issue
Block a user