Add --context-lens flag#48
Open
knocte wants to merge 19 commits into
Open
Conversation
8310741 to
4b8bd0f
Compare
136d4d9 to
42b7e23
Compare
Contributor
Author
Contributor
Author
No no no, this patch was created in this PR, so this commit has to be squashed. |
d6731dc to
a868f42
Compare
Added a --context-lens (-c) flag, that installs context-lens after installing Pi, and creates a launcher script "cpi" for it. context-lens is installed from git repository, with 2 patches applied: - Enable using PPQ.ai in Pi through MITM proxy. - When launching pi, add providers based on env. vars & auth.json. Launcher script launches context-lens with `pi` argument. Context-lens sets up pi (creates temp pi directory with modified settings), in particular to route its traffic through mitmproxy. Otherwise context-lens wouldn't be able to capture requests. Launcher script can't use `spi` because `pi` argument is not an executable name but a switch that tells context-lens to perform mentioned pi setup.
…lanation comments for env vars
Otherwise there would be a permission error on fresh install: ``` fatal: could not create work tree dir 'context-lens': Permission denied Error: Error: command 'git' failed (exit code 128) ```
To have less changes in the PR, because now cpi script is calling spi and thus createContextLensLauncherScript no longer needs to shares code with createLauncherScript. There are still some changes to createLauncherScript due to forwarding of proxy env. vars.
And if true, then just launch pi using spi wrapper. But that other pi instance's requests won't be captured by context-lens.
Now extra pi instnaces launched using cpi script route their requests through contex-lens mitm proxy so the requests are captured. However they are all lumped together as if it was a single session.
a868f42 to
b36b17f
Compare
43c4cd5 to
1206ab4
Compare
…her script" This reverts commit 7aa1781.
Contributor
Author
|
Contributor
Author
|
Also let's fix CI. |
Instead use context-lens with regular proxy and set UPSTREAM_OPENAI_URL to https://api.ppq.ai. This will only work after [1] is merged. [1] tarsgate/awto-pi-lot#44
49cde1f to
d807d60
Compare
Collaborator
|
We also have to abandon the idea of reusing |
Contributor
Author
|
ok |
That includes tarsgate/awto-pi-lot#44 in order to be able to test this PR.
Because context-lens has to receive "pi" argument to prepare pi directory with modified models.json.
3ada093 to
c483e2e
Compare
knocte
commented
Jun 20, 2026
| contextLensDir: string, | ||
| apiKeyExport: Option<{ name: string; value: string }> = Nothing | ||
| ): Promise<void> { | ||
| const cmd = `HOME=${agentUserHome} UPSTREAM_OPENAI_URL=https://api.ppq.ai node ${contextLensDir}/dist/cli.js pi`; |
Contributor
Author
There was a problem hiding this comment.
@webwarrior-ws what is this? skynot is not PPQ related
Collaborator
There was a problem hiding this comment.
I raised this in Telegram group, and you said "I don't care about that for now".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #41
Because after I tried last state of that PR, I encountered the following problems:
aidev:(Note, the solution was to run CL via current user while keep running Pi with
aidevviaspi.)