Skip to content
PifeatureCLI & tooling2 files · +71 −41

Add --mode rpc and configurable ports to ppi script

Session from combust-labs_pi-mono-docker on Hugging Face by rgruchalski · Apache-2.0 · condensed by Coders Talk

18msession
2interventions
GOAL

Modify the ppi Docker wrapper script to trigger RPC mode via --mode rpc instead of only --port, and add configurable internal/host container port flags.

  1. Prompt · +2m
    Propose only (no code changes): allow --mode rpc to trigger RPC mode, and add --ppi-container-port and --ppi-host-port flags, with host port defaulting to container port (default 3000).
  2. Prompt · +4m
    You can ignore backward compatibility; please implement.
  3. Fail · +6m
    Multiple edit attempts on ppi failed repeatedly with 'Could not find edits, oldText must match exactly' errors, even after re-reading file offsets and checking whitespace with cat -A.
  4. Agent did · +6m
    Debugged the exact-match edit failures by reading file sections, using sed and cat -A to inspect whitespace, and finally used Python byte-search to find the exact text before applying smaller, targeted edits (e.g. changing 'text|json)' to 'text|json|rpc)').
  5. Intervention · +11m
    Told the agent to implement the port/mode changes but explicitly not to remove the --port flag, leaving that for the human to do manually.
    Why: I wanted to remove --port myself since the agent kept struggling with matching that section of the file.
  6. Agent did · +11m
    Added use_ppi_container_port and use_ppi_host_port variables (default 3000), new --ppi-container-port/--ppi-host-port flag handlers, updated is_valid_mode and the docker run condition to trigger on --mode rpc, and wired the port variables into the -p mapping and PORT env var.
  7. Intervention · +15m
    Told the agent 'I have removed the --port flag, do nothing' after manually editing the script.
    Why: I removed the leftover --port flag myself by hand since I'd told the agent to leave it alone.
  8. Prompt · +15m
    Update the README to cover the cleaned up --port flag.
  9. Agent did · +15m
    Updated README.md to remove --port references, document --mode rpc as the RPC trigger, and describe the new --ppi-container-port and --ppi-host-port flags with updated examples.
  10. Outcome · +18m
    Session ended with a request to commit all changes on the current branch with a meaningful, self-credited commit message and verify a clean working tree.
VERDICT

Next time I'd ask upfront for the exact diff format the tool needs, since a huge chunk of this session was wasted on the edit tool failing to match whitespace-exact oldText in the ppi script. The intervention that actually helped was telling it to leave the --port flag removal to me by hand — the agent kept tripping over that section, and doing it myself was faster and safer.

I tried this · 0

Discussion · 0

How Builds work