PERPLEXITY_API_KEY_COMMAND in the roles pack's Researcher MCP line #89
No reviewers
Labels
No labels
No milestone
No project
No assignees
2 participants
Due date
No due date set.
Dependencies
No dependencies set
Reference
mikluko/gascitypacks!89
Loading…
Reference in a new issue
No description provided.
Delete branch "worker/gascitypacks-h7fn"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The Researcher's Perplexity MCP line (
roles/agents/researcher/mcp/perplexity.toml) no longer names the city. It reads the key from the session's environment:PERPLEXITY_API_KEY_COMMAND, when set and not empty, is run withsh -cand its stdout is the key. A failing or silent command is a failed start; the file is not a fall back.PERPLEXITY_API_KEY_FILEnames the file. With neither variable, or an empty or missing key, the line prints a message on stderr and exits 1 beforenpxruns.~/.config/gascity-root/perplexity-token: it setsPERPLEXITY_API_KEY_FILE(or the command) in a patch ofroles.researcher. The changelog fragment says so.Also changed: the README's section on the key and
.changelog/perplexity-key-command.md.How I checked.
tests/researcher.shnow asserts the definition (pinned, names both variables, nogascity,.configorHOMEoutside comments, noenventry) and runs the projected line withsh -cand a stubnpxwith made-up keys: command and file both set, a pipeline command, file only, empty command plus file, neither (message names both variables), a failing command with a file present, a silent command, an empty file and a missing file; it also checks the key is not innpx's arguments. I restored the old toml and the test failed on 10 checks; with the change restored it passes. I ran the line by hand under/bin/sh, bash and dash too.changelog -base mainandgo test ./internal/budgetpass.Not checked. That the session's environment reaches the MCP server in the acp box (a Researcher session calling
perplexity_search) is not shown by anything here, as the bead says; the city's own change has to try it. The city's patch ofroles.researcher(PERPLEXITY_API_KEY_COMMANDwith thebaocommand) is not in this pull request.Bead: gascitypacks-h7fn
Correction to the description: with the old toml restored,
tests/researcher.shfailed on 9 checks, not 10.Review of
da3b691349for gascitypacks-h7fn. Checks of the head: success.Verdict
pass
Findings
k=$(sh -c "$PERPLEXITY_API_KEY_COMMAND") || exit 1), so a command that fails silently (printf k2; exit 4, tried by hand) exits 1 with nothing on stderr. Either echo a line such asperplexity: PERPLEXITY_API_KEY_COMMAND failedbeforeexit 1, or say that the message is the command's own.Verified
PERPLEXITY_API_KEY_COMMAND(stdout is the key), with the file used only when it is not set, and the path moved out of the pack intoPERPLEXITY_API_KEY_FILE. The diff does that and nothing else: the toml line, its comment, the README's "The key" paragraph,tests/researcher.shand a changelog fragment marking the dropped default path as Breaking. An empty command counts as unset, and the test covers that. The city's patch ofroles.researcheris left out, as the bead says it should be.origin/main(176c520) as a fast-forward. The forge saysmergeable.go vet ./...,go test ./...,go test -race ./...andgo test -v -run TestShellBudget ./internal/budget(31 units, 0 findings);gc lint .(2 packs ok); every script of thelintandscriptsjobs (researcher, researcher-formula, formula, reviewer, operator-overlay, pack-cache, worktree-setup, worktree, gnu-tools, merge, handover, failures, waiting, apply, upgrade, view-beads, view-mail, permission-deny, permission-request); andchangelog -base main(valid=true). All pass.perplexity.tomlput back on the merge result,tests/researcher.shfails 9 checks (the description says 10), so the new checks test the line./bin/shand/bin/dashwith a stubnpx. A file key with a space and trailing newlines comes through asabc def. A command's stderr passes through and its stdout is the key. A failing command with a file present exits 1 without reading the file. An emptyPERPLEXITY_API_KEY_FILEprints the:?message naming both variables. A missing file givescat's message. In every case the key is innpx's environment and not in its arguments.rm -fis under the script's ownmktemp -ddirectory, which REVIEW.md allows. The newgrepq ... && faillines are safe underset -e. The oneiflives in the toml'ssh -cstring, which the budget does not count, and the bead asked for that shape.