Skip to content

Commit

Permalink
Bump cody commit, adjust agent launch params (#1887)
Browse files Browse the repository at this point in the history
## Test plan

Full QA according to a test plan.
As for launch script args change that is covered by automatic tests.
  • Loading branch information
pkukielka authored and steveyegge committed Jul 9, 2024
1 parent 75f3406 commit a670b86
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ kotlin.stdlib.default.dependency=false
nodeBinaries.commit=8755ae4c05fd476cd23f2972049111ba436c86d4
nodeBinaries.version=v20.12.2
cody.autocomplete.enableFormatting=true
cody.commit=65a42c66054cdbe2872de865835167eed9fabc20
cody.commit=aa6e4fe6f24bede84f304705eeaf68ba2ef3546f
19 changes: 15 additions & 4 deletions src/main/kotlin/com/sourcegraph/cody/agent/CodyAgent.kt
Original file line number Diff line number Diff line change
Expand Up @@ -150,24 +150,35 @@ private constructor(
val token = CancellationToken()

val binaryPath = nodeBinary(token).absolutePath
val jsonRpcArgs = arrayOf("api", "jsonrpc-stdio")
val command: List<String> =
if (System.getenv("CODY_DIR") != null) {
val script = File(System.getenv("CODY_DIR"), "agent/dist/index.js")
logger.info("using Cody agent script " + script.absolutePath)
if (shouldSpawnDebuggableAgent()) {
listOf(binaryPath, "--inspect-brk", "--enable-source-maps", script.absolutePath)
listOf(
binaryPath,
"--inspect-brk",
"--enable-source-maps",
script.absolutePath,
*jsonRpcArgs)
} else {
listOf(binaryPath, "--enable-source-maps", script.absolutePath)
listOf(binaryPath, "--enable-source-maps", script.absolutePath, *jsonRpcArgs)
}
} else {
val script =
agentDirectory()?.resolve("index.js")
?: throw CodyAgentException(
"Sourcegraph Cody + Code Search plugin path not found")
if (shouldSpawnDebuggableAgent()) {
listOf(binaryPath, "--inspect", "--enable-source-maps", script.toFile().absolutePath)
listOf(
binaryPath,
"--inspect",
"--enable-source-maps",
script.toFile().absolutePath,
*jsonRpcArgs)
} else {
listOf(binaryPath, script.toFile().absolutePath)
listOf(binaryPath, script.toFile().absolutePath, *jsonRpcArgs)
}
}

Expand Down

0 comments on commit a670b86

Please sign in to comment.