Skip to content

Eliminate shell/Python duplication in entrypoint and proxy scripts#143

Merged
bbrowning merged 1 commit intomainfrom
shell-python-dedupe
Mar 27, 2026
Merged

Eliminate shell/Python duplication in entrypoint and proxy scripts#143
bbrowning merged 1 commit intomainfrom
shell-python-dedupe

Conversation

@bbrowning
Copy link
Copy Markdown
Owner

Move sandbox config generation and domain ACL formatting from shell
to Python, removing ~250 lines of duplicated bash logic. Split the
main entrypoint (508 → 169 lines) into sourced libraries for
maintainability.

Key changes:

  • Activate Python-generated sandbox config scripts via both backends,
    removing the 117-line bash fallback in entrypoint-session.sh
  • Add format_domains_as_squid_acls() to domains.py, passing
    pre-formatted ACLs to the proxy container (62 vs 121 lines)
  • Split entrypoint-session.sh into entrypoint-lib-{config,credentials,
    install}.sh sourced libraries
  • Fix minor shell anti-patterns (basename→parameter expansion,
    cat→$(<), redundant chmod consolidation)
  • Fix Cursor sandbox config ws_slug parameter expansion (assign
    workspace to local variable before bash string replacement)
  • Add fallback dstdomain ACL when only regex domains are present

Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com

Move sandbox config generation and domain ACL formatting from shell
to Python, removing ~250 lines of duplicated bash logic. Split the
main entrypoint (508 → 169 lines) into sourced libraries for
maintainability.

Key changes:
- Activate Python-generated sandbox config scripts via both backends,
  removing the 117-line bash fallback in entrypoint-session.sh
- Add format_domains_as_squid_acls() to domains.py, passing
  pre-formatted ACLs to the proxy container (62 vs 121 lines)
- Split entrypoint-session.sh into entrypoint-lib-{config,credentials,
  install}.sh sourced libraries
- Fix minor shell anti-patterns (basename→parameter expansion,
  cat→$(<), redundant chmod consolidation)
- Fix Cursor sandbox config ws_slug parameter expansion (assign
  workspace to local variable before bash string replacement)
- Add fallback dstdomain ACL when only regex domains are present

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@bbrowning bbrowning merged commit 655b63f into main Mar 27, 2026
6 checks passed
@bbrowning bbrowning deleted the shell-python-dedupe branch March 27, 2026 19:34
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